/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};

/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {

/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId])
/******/ 			return installedModules[moduleId].exports;

/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			exports: {},
/******/ 			id: moduleId,
/******/ 			loaded: false
/******/ 		};

/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);

/******/ 		// Flag the module as loaded
/******/ 		module.loaded = true;

/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}


/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;

/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;

/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";

/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {

	//require("./common/run-moa.js");__webpack_require__(1);__webpack_require__(2);__webpack_require__(3);__webpack_require__(4);__webpack_require__(5);__webpack_require__(6);__webpack_require__(7);__webpack_require__(8);__webpack_require__(9);// require("../../Scripts/View/mobile/login.js");//require("../../Scripts/View/FormCtrl.js");//打前端包时注释掉后面//require("../../Scripts/View/loginAdmin.js");//moa统计__webpack_require__(10);__webpack_require__(15);__webpack_require__(19);__webpack_require__(20);__webpack_require__(21);__webpack_require__(22);__webpack_require__(23);__webpack_require__(24);//builder数据到此为止

/***/ },
/* 1 */
/***/ function(module, exports) {

	'use strict';

	var Settings = {

	    siteAssetURL: "/Scripts/",
	    siteRelativeRoot: "..",
	    siteURL: "../Scripts/",
	    PublicScriptURL: "https://spengineeringltd-public.sharepoint.com/SiteAsset/Scripts/"
	};



	angular.module('formlyObj.services', []);
	angular.module('formlyObj.controllers', []);
	var app = angular.module('formlyObj', ['formly', 'formlyBootstrap','builder', 'builder.components', 'validator.rules', 'ngRoute','ngAnimate','toaster','formlyObj.services','formlyObj.controllers'])
	/* 'angularFileUpload',*/

	angular.module('formlyObj').config(['$routeProvider','$locationProvider',
	    function ($routeProvider,$locationProvider) {
	        //$locationProvider.hashPrefix('');
	        //$locationProvider.html5Mode(true);
	    $routeProvider.
	       //when('/
	    // FormPublish', {
	       //    templateUrl: Settings.siteURL + 'View/FormPublish.html',
	       //    controller: 'PublishCtrl',
	       //    controllerAs: 'vm'

	       //}).
	//打前端包从此注释


	        //统计分析导航页
	        when('/moa-count', {
	            templateUrl:'Scripts/View/moa-count.html',
	            controller: 'MoaCountCtrl',
	            controllerAs: 'vm'
	        })

	        .when('/punch-detail', {
	            templateUrl:'Scripts/View/punch/punch-detail.html',
	            controller: 'PunchDetailCtrl',
	            controllerAs: 'vm'
	        })
	        .when('/punch-whitelist', {
	            templateUrl:'Scripts/View/punch/punch-whitelist.html',
	            controller: 'PunchWhitelistCtrl',
	            controllerAs: 'vm'
	        })
	        .when('/punch-addPerson', {
	            templateUrl:'Scripts/View/punch/punch-whitelist-addPerson.html',
	            controller: 'PunchAddPersonCtrl',
	            controllerAs: 'vm'
	        })
	        .when('/punch-sitelist', {
	            templateUrl:'Scripts/View/punch/punch-sitelist.html',
	            controller: 'PunchSitelistCtrl',
	            controllerAs: 'vm',
	            cache : true
	        })
	        .when('/punch-addSite', {
	            templateUrl:'Scripts/View/punch/punch-whitelist-addSite.html',
	            controller: 'PunchAddSiteCtrl',
	            controllerAs: 'vm'
	        })
	        .when('/punch-addReocord', {
	            templateUrl:'Scripts/View/punch/punch-addRecord.html',
	            controller: 'PunchAddRecordCtrl',
	            controllerAs: 'vm'
	        })
	        .when('/punch-editRecord', {
	            templateUrl:'Scripts/View/punch/punch-editRecord.html',
	            controller: 'PunchEditRecordCtrl',
	            controllerAs: 'vm'
	        })

	        .otherwise({

	          // redirectTo: '/PCquestion-list' //pc默认页
	            redirectTo: window.systemConfig.appEntry //pc默认页
	       });


	}]);

	// angular.module("formlyObj",["ui.router"]).config(function($stateProvider,$urlRouterProvider){//.config 配置路由信息
	//     //$urlRouterProvider.when("","/login")
	//     $stateProvider.state("test",{
	//         templateUrl:'test.html', //templateUrl 跳转到哪个页面去
	//         url:'/test'
	//     })
	// })


	app.filter('to_trusted', ['$sce', function ($sce) {
	    return function (text) {
	        return $sce.trustAsHtml(text);
	    };
	}]);


	app.filter('getByKey', function () {
	    return function (input, key) {
	        var i = 0, len = input.length;
	        for (; i < len; i++) {
	            if (input[i].key == key) {
	                var returnObj = input[i];
	                var j = i + 1;
	                return { obj: returnObj, index: j };
	            }
	        }
	        return null;
	    }
	});

	app.filter('getByProperty', function () {
	    return function (input, propertyName, propertyValue) {
	        var i = 0, len = input.length;
	        for (; i < len; i++) {
	            if (input[i].hasOwnProperty(propertyName) && input[i][propertyName] == propertyValue) {
	                var returnObj = input[i];

	                return { obj: returnObj, index: i };
	            }
	        }
	        return null;
	    }
	});
	app.filter('getByHasProperty', function () {
	    return function (input, propertyName) {
	        var foundObjs = new Array();
	        var i = 0, len = input.length;
	        for (; i < len; i++) {
	            if (input[i].hasOwnProperty(propertyName)) {
	                foundObjs.push(input[i]);
	            }
	        }
	        return foundObjs;
	    }
	});








/***/ },
/* 2 */
/***/ function(module, exports) {

	(function() {

	  angular.module('formlyObj.services').factory('GlobalStorageService', GlobalStorageService);

	  function GlobalStorageService() {
	    var GlobalStorage = function(){
	      var self = this;
	      var questionData;
	      var surveyId="";
	      var editSurveyId="";
	      var hasEdit=false;
	      var surveyData={};
	      var surveyBase={};
	      var surveyStaus="";
	      var oldbase=false;
	      var userId="";
	      var questTitle="";
	        var hasReply=false;

	        var hasLogin=false;
	        var useridLog=false;
	        var userName;//登录用户名-----
	        var siteList;//打卡点列表
	        var whiteUser={};//白名单人员
	        var Site={};//打卡点信息
	        var Record={};//打卡点信息
	        var index=0;

	        self.setRecord = function(token){
	            Record = token;
	        };
	        self.getRecord = function(){
	            return Record;
	        };
	        self.setSite = function(token){
	            Site = token;
	        };
	        self.getSite = function(){
	            return Site;
	        };
	        self.setIndex = function(token){
	            index = token;
	        };
	        self.getIndex = function(){
	            return index;
	        };
	        self.setWhiteUser = function(token){
	            whiteUser = token;
	        };
	        self.getWhiteUser = function(){
	            return whiteUser;
	        };
	        self.setSiteList = function(token){
	            siteList = token;
	        };
	        self.getSiteList = function(){
	            return siteList;
	        };
	        self.setUseridLog = function(token){
	            useridLog = token;
	        };
	        self.getUseridLog = function(){
	            return useridLog;
	        };
	        self.setHasLogin = function(token){
	            hasLogin = token;
	        };
	        self.getHasLogin = function(){
	            return hasLogin;
	        };
	        self.setHasReply = function(token){
	            hasReply = token;
	        };
	        self.getHasReply = function(){
	            return hasReply;
	        };
	        self.setQuestTitle = function(token){
	            questTitle = token;
	        };
	        self.getQuestTitle = function(){
	            return questTitle;
	        };
	        self.setUserId = function(token){
	            userId = token;
	        };
	        self.getUserId = function(){
	            return userId;
	        };
	        self.setOldbase = function(token){
	            oldbase = token;
	        };
	        self.getOldbase = function(){
	            return oldbase;
	        };
	        self.setHasEdit = function(token){
	            hasEdit = token;
	        };
	        self.getHasEdit = function(){
	            return hasEdit;
	        };
	        self.setSurveyStaus = function(token){
	            surveyStaus = token;
	        };
	        self.getSurveyStaus = function(){
	            return surveyStaus;
	        };
	        self.setSurveyBase = function(token){
	            surveyBase = token;
	        };
	        self.getSurveyBase = function(){
	            return surveyBase;
	        };
	        self.setSurveyData = function(token){
	            surveyData = token;
	        };
	        self.getSurveyData = function(){
	            return surveyData;
	        };
	        self.setEditSurveyId = function(token){
	            editSurveyId = token;
	        };
	        self.getEditSurveyId = function(){
	            return editSurveyId;
	        };
	        self.setSurveyId = function(token){
	            surveyId = token;
	        };
	        self.getSurveyId = function(){
	            return surveyId;
	        };
	      self.setQuestionData = function(token){
	          questionData = token;
	      };
	      self.getQuestionData = function(){
	        return questionData;
	      };
	        self.setUserName = function(name){
	            userName = name;
	        };
	        self.getUserName = function(){
	            return userName;
	        };
	    };
	    return new GlobalStorage();
	  }


	}());


/***/ },
/* 3 */
/***/ function(module, exports) {

	
	(function () {
	    var copyObjectToScope;

	    copyObjectToScope = function (object, scope) {

	        /*
	        Copy object (ng-repeat="object in objects") to scope without `hashKey`.
	         */
	        var key, value;
	        for (key in object) {
	            value = object[key];
	            if (key !== '$$hashKey') {
	                scope[key] = angular.copy(value);
	            }
	        }
	    };

	    var appController = angular.module('builder.controller', ['builder.provider']);

	    appController.controller('fbFormObjectEditableController', [
	      '$scope', '$injector', function ($scope, $injector) {
	          var $builder;
	          $builder = $injector.get('$builder');
	            //console.log('fbFormObjectEditableController start');
	          $scope.setupScope = function (formObject) {
	              //console.log('setupScope start');
	                //console.log(formObject);
	              /*
	              1. Copy origin formObject (ng-repeat="object in formObjects") to scope.
	              2. Setup optionsText with formObject.options.
	              3. Watch scope.label, .description, .placeholder, .required, .options then copy to origin formObject.
	              4. Watch scope.optionsText then convert to scope.options.
	              5. setup validationOptions
	               */
	              var component;
	              copyObjectToScope(formObject, $scope);
	              $scope.optionsText = formObject.options.join('\n');
	              $scope.$watch('[key,label, description, placeholder, required, options, validation,templateOptions,expressionProperties,userinfo]', function () {
	                  formObject.key = $scope.key;
	                  formObject.label = $scope.label;
	                  formObject.description = $scope.description;
	                  formObject.placeholder = $scope.placeholder;
	                  formObject.required = $scope.required;
	                  formObject.options = $scope.options;
	                  formObject.templateOptions = $scope.templateOptions;
	                  formObject.expressionProperties = $scope.expressionProperties;
	                  formObject.userinfo = $scope.userinfo;
	                  
	                  
	                  return formObject.validation = $scope.validation;
	              }, true);
	              $scope.$watch('optionsText', function (text) {
	                  var x;
	                  $scope.options = (function () {
	                      var _i, _len, _ref, _results;
	                      _ref = text.split('\n');
	                      _results = [];
	                      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
	                          x = _ref[_i];
	                          if (x.length > 0) {
	                              _results.push(x);
	                          }
	                      }
	                      return _results;
	                  })();
	                  return $scope.inputText = $scope.options[0];
	              });
	              component = $builder.components[formObject.component];
	              return $scope.validationOptions = component.validationOptions;
	          };


	          return $scope.data = {
	              model: null,
	              backup: function () {

	                  /*
	                  Backup input value.
	                   */
	                  return this.model = {
	                      label: $scope.label,
	                      description: $scope.description,
	                      placeholder: $scope.placeholder,
	                      required: $scope.required,
	                      optionsText: $scope.optionsText,
	                      validation: $scope.validation,
	                      key: $scope.key,
	                      templateOptions: $scope.templateOptions,
	                      expressionProperties: $scope.expressionProperties,
	                      userinfo : $scope.userinfo
	                  };
	              },
	              rollback: function () {

	                  /*
	                  Rollback input value.
	                   */
	                  if (!this.model) {
	                      return;
	                  }
	                  $scope.label = this.model.label;
	                  $scope.description = this.model.description;
	                  $scope.placeholder = this.model.placeholder;
	                  $scope.required = this.model.required;        
	                  $scope.optionsText = this.model.optionsText;
	                  $scope.key = this.model.key;
	                  $scope.templateOptions = this.model.templateOptions;
	                  $scope.expressionProperties = this.model.expressionProperties;
	                  $scope.userinfo = this.model.userinfo;
	                  
	                  return $scope.validation = this.model.validation;
	              }
	          };
	      }
	    ]);

	    appController.controller('fbComponentsController', [
	      '$scope', '$injector', function ($scope, $injector) {
	            //console.log('fbComponentsController start');
	          var $builder;
	          $builder = $injector.get('$builder');
	          $scope.selectGroup = function ($event, group) {
	              var component, name, _ref, _results;
	              if ($event != null) {
	                  $event.preventDefault();
	              }
	              $scope.activeGroup = group;
	              $scope.components = [];
	              _ref = $builder.components;
	              _results = [];
	              for (name in _ref) {
	                  component = _ref[name];
	                  if (component.group === group) {
	                      _results.push($scope.components.push(component));
	                  }
	              }
	              return _results;
	          };
	          $scope.groups = $builder.groups;
	          $scope.activeGroup = $scope.groups[0];
	          $scope.allComponents = $builder.components;
	          return $scope.$watch('allComponents', function () {
	              return $scope.selectGroup(null, $scope.activeGroup);
	          });
	      }
	    ]);

	    appController.controller('fbComponentController', [
	      '$scope', function ($scope) {
	          return $scope.copyObjectToScope = function (object) {
	              return copyObjectToScope(object, $scope);
	          };
	      }
	    ]);

	    appController.controller('fbFormController', [
	      '$scope', '$injector', function ($scope, $injector) {
	          var $builder, $timeout;
	          $builder = $injector.get('$builder');
	          $timeout = $injector.get('$timeout');
	          if ($scope.input == null) {
	              $scope.input = [];
	          }
	          return $scope.$watch('form', function () {
	              if ($scope.input.length > $scope.form.length) {
	                  $scope.input.splice($scope.form.length);
	              }
	              return $timeout(function () {
	                  return $scope.$broadcast($builder.broadcastChannel.updateInput);
	              });
	          }, true);
	      }
	    ]);
	    appController.controller('fbFormObjectController', [
	      '$scope', '$injector', function ($scope, $injector) {
	          var $builder;
	          $builder = $injector.get('$builder');
	          $scope.copyObjectToScope = function (object) {
	              return copyObjectToScope(object, $scope);
	          };
	          return $scope.updateInput = function (value) {

	              /*
	              Copy current scope.input[X] to $parent.input.
	              @param value: The input value.
	               */
	              var input;
	              input = {
	                  id: $scope.formObject.id,
	                  label: $scope.formObject.label,
	                  templateOptions: $scope.formObject.templateOptions,
	                  value: value != null ? value : ''
	              };
	              return $scope.$parent.input.splice($scope.$index, 1, input);
	          };
	      }
	    ]);

	}).call(this);

	(function () {
	    directives = angular.module('builder.directive', ['builder.provider', 'builder.controller', 'builder.drag', 'validator','formlyObj.services']);

	    directives.directive('fbBuilder', [
	      '$injector','GlobalStorageService', function ($injector,GlobalStorageService) {
	        //console.log('fbBuilder start');

	          var $builder, $drag;
	          $builder = $injector.get('$builder');
	          $drag = $injector.get('$drag');
	          return {
	              restrict: 'A',
	              scope: {
	                  fbBuilder: '@'
	              },
	              template: "<div class=''>\n    <div class='fb-form-object-editable form-group' ng-repeat=\"object in formObjects\"\n        fb-form-object-editable=\"object\"></div>\n</div>",
	              link: function (scope, element, attrs) {
	                  var beginMove, _base, _name;
	                  var markNew=  GlobalStorageService.getHasEdit();

	                  GlobalStorageService.setHasEdit(false);
	                  //console.log(markNew);
	                  //no fbBuilder value, this is the element on the design panel
	                  if (!attrs.fbBuilder)
	                  {
	                      $(element).addClass('fb-builder');
	                      return;
	                  }
	                      
	                  scope.formName = attrs.fbBuilder;
	                  //console.log( scope.formName );
	                  if ((_base = $builder.forms)[_name = scope.formName] == null) {
	                      _base[_name] = [];
	                  }
	                  if(markNew){//初始化时模拟读取已保存的builder
	                      var oldDatas=GlobalStorageService.getSurveyData();
	                      GlobalStorageService.setSurveyData({});
	                      for(w in oldDatas)
	                      {
	                          $builder.forms[w]=  oldDatas[w];//在此处赋予初始值
	                      }

	                      markNew=false;
	                  }
	                  scope.$watch(GlobalStorageService.getHasEdit(), function () {

	                      scope.formObjects = $builder.forms[scope.formName];
	                      //console.log(eval( scope.formObjects ));
	                      beginMove = true;
	                      $(element).addClass('fb-builder');
	                      return $drag.droppable($(element), {
	                          move: function (e) {
	                              var $empty, $formObject, $formObjects, height, index, offset, positions, _i, _j, _ref, _ref1;
	                              if (beginMove) {
	                                  $("div.fb-form-object-editable").popover('hide');
	                                  beginMove = false;
	                              }
	                              $formObjects = $(element).find('.fb-form-object-editable:not(.empty,.dragging,.fb-form-object-editable .fb-form-object-editable)');
	                              if ($formObjects.length === 0) {
	                                  if ($(element).find('.fb-form-object-editable.empty').length === 0) {
	                                      $(element).find('>div:first').append($("<div class='fb-form-object-editable empty'></div>"));
	                                  }
	                                  return;
	                              }
	                              positions = [];
	                              positions.push(-1000);
	                              for (index = _i = 0, _ref = $formObjects.length; _i < _ref; index = _i += 1) {
	                                  $formObject = $($formObjects[index]);
	                                  offset = $formObject.offset();
	                                  height = $formObject.height();
	                                  positions.push(offset.top + height);
	                              }
	                              positions.push(positions[positions.length - 1] + 1000);
	                              for (index = _j = 1, _ref1 = positions.length; _j < _ref1; index = _j += 1) {



	                                  if (e.pageY > positions[index - 1] && e.pageY <= positions[index]) {


	                                      var elementIsContainer = false;
	                                      if (index - 1 >= 0)
	                                      {
	                                          //if hoved over element is container

	                                          elementIsContainer = $($formObjects[index - 1]).find(".fb-builder").length > 0;


	                                      }


	                                      $(element).find('.empty').remove();
	                                      $empty = $("<div class='fb-form-object-editable empty'></div>");
	                                      if (!elementIsContainer) {

	                                          //only move pass the element before add the empty element, this is for the nested element

	                                          if (index - 1 < $formObjects.length) {

	                                              $empty.insertBefore($($formObjects[index - 1]));

	                                          } else {

	                                              $empty.insertAfter($($formObjects[index - 2]));

	                                          }

	                                      }
	                                      else
	                                      {
	                                          containerTop = $($formObjects[index - 1]).offset().top;
	                                          if (e.pageY <= containerTop) {
	                                              $empty.insertBefore($($formObjects[index - 1]));
	                                          }


	                                      }
	                                      break;
	                                  }

	                              }
	                          },
	                          out: function () {
	                              if (beginMove) {
	                                  $("div.fb-form-object-editable").popover('hide');
	                                  beginMove = false;
	                              }
	                              return $(element).find('.empty').remove();
	                          },
	                          up: function (e, isHover, draggable) {
	                              var formObject, newIndex, oldIndex;
	                              beginMove = true;
	                              if (!$drag.isMouseMoved()) {
	                                  $(element).find('.empty').remove();
	                                  return;
	                              }
	                              if (!isHover && draggable.mode === 'drag') {
	                                  formObject = draggable.object.formObject;
	                                  if (formObject.editable) {
	                                      //  $builder.removeFormObject(attrs.fbBuilder, formObject.index);
	                                  }
	                              } else if (isHover) {


	                                  if (draggable.mode === 'mirror') {
	                                      //drag an element from component area
	                                      //  if ($(draggable.element).find(".DropableDesign").length > 0)
	                                      //     app.isMirrorDrop = true;
	                                      $builder.insertFormObject(scope.formName, $(element).find('.empty').index(), {
	                                          component: draggable.object.componentName
	                                      });
	                                  }

	                                  if (draggable.mode === 'drag') {
	                                      //if it is move
	                                      formObject = draggable.object.formObject;
	                                      var newFormObjectID, oldFormObjectID;
	                                      var idParts = formObject.id.split("-");
	                                      //id alwasy is formname-component name-randon number
	                                      //so remove the last two elements will give you the form name
	                                      var formNameParts = idParts;
	                                      var elementNameParts = formNameParts.splice(-2, 2)
	                                      var oldFormName = formNameParts.join("-");
	                                      //if (oldFormName === scope.formName) {
	                                      //    console.error("origin and destination form are the same as " + oldFormName + ". Abort")
	                                      //    return;
	                                      //}
	                                      newIdParts=[];
	                                      newIdParts.push(scope.formName);
	                                      newIdParts.push(elementNameParts.join("-"))


	                                      newFormObjectID = newIdParts.join("-");
	                                      oldFormObjectID = formObject.id;
	                                      changePropertyName = function (obj,searchString,subString) {
	                                          angular.forEach(obj, function (value, key, thisobj) {
	                                              if (value.id.indexOf(searchString) > -1)
	                                              {
	                                                  var oldid = value.id;
	                                                  var newid = value.id.replace(searchString, subString);
	                                                  value.id = newid;
	                                                  //if this component is container, loop
	                                                  if (value.isContainer)
	                                                  {
	                                                      $builder.forms[newid] = $builder.forms[oldid];
	                                                      delete $builder.forms[oldid];
	                                                      changePropertyName($builder.forms[newid], oldid, newid);
	                                                  }

	                                              }
	                                          });
	                                      };
	                                      if (newFormObjectID !== oldFormObjectID)
	                                      {
	                                          formObject.id = newFormObjectID;
	                                          var currentElementIsContainer = formObject.isContainer;
	                                          if (currentElementIsContainer && $builder.forms[oldFormObjectID]) {
	                                              $builder.forms[newFormObjectID] = $builder.forms[oldFormObjectID];
	                                              delete $builder.forms[oldFormObjectID];
	                                              changePropertyName($builder.forms[newFormObjectID], oldFormObjectID, newFormObjectID);
	                                          }
	                                      }


	                                      newIndex = $(element).find('.empty').index();

	                                      $builder.removeFormObject(oldFormName, formObject.index);
	                                      $builder.insertFormObject(scope.formName, newIndex, formObject);


	                                  }
	                                  return $(element).find('.empty').remove();
	                              }

	                          }
	                      });
	                  }, true);

	                /*  if(markNew){//初始化时模拟读取已保存的builder
	                      var oldDatas=GlobalStorageService.getSurveyData();
	                      $builder.forms[scope.formName]= oldDatas;//在此处赋予初始值
	                      markNew=false;
	                  }*/
	                  //$builder.forms[scope.formName]=[];

	                 /* scope.formObjects = $builder.forms[scope.formName];
	                  console.log(eval( scope.formObjects ));
	                  beginMove = true;
	                  $(element).addClass('fb-builder');
	                  return $drag.droppable($(element), {
	                      move: function (e) {
	                          var $empty, $formObject, $formObjects, height, index, offset, positions, _i, _j, _ref, _ref1;
	                          if (beginMove) {
	                              $("div.fb-form-object-editable").popover('hide');
	                              beginMove = false;
	                          }
	                          $formObjects = $(element).find('.fb-form-object-editable:not(.empty,.dragging,.fb-form-object-editable .fb-form-object-editable)');
	                          if ($formObjects.length === 0) {
	                              if ($(element).find('.fb-form-object-editable.empty').length === 0) {
	                                  $(element).find('>div:first').append($("<div class='fb-form-object-editable empty'></div>"));
	                              }
	                              return;
	                          }
	                          positions = [];
	                          positions.push(-1000);
	                          for (index = _i = 0, _ref = $formObjects.length; _i < _ref; index = _i += 1) {
	                              $formObject = $($formObjects[index]);
	                              offset = $formObject.offset();
	                              height = $formObject.height();
	                              positions.push(offset.top + height);
	                          }
	                          positions.push(positions[positions.length - 1] + 1000);
	                          for (index = _j = 1, _ref1 = positions.length; _j < _ref1; index = _j += 1) {



	                              if (e.pageY > positions[index - 1] && e.pageY <= positions[index]) {
	                                
	                                  
	                                  var elementIsContainer = false;
	                                  if (index - 1 >= 0)
	                                  {
	                                      //if hoved over element is container
	                                     
	                                      elementIsContainer = $($formObjects[index - 1]).find(".fb-builder").length > 0;
	                                      
	                                      
	                                        }
	                             
	                                 
	                                  $(element).find('.empty').remove();
	                                  $empty = $("<div class='fb-form-object-editable empty'></div>");
	                                  if (!elementIsContainer) {
	                                      
	                                      //only move pass the element before add the empty element, this is for the nested element

	                                      if (index - 1 < $formObjects.length) {

	                                          $empty.insertBefore($($formObjects[index - 1]));

	                                      } else {

	                                          $empty.insertAfter($($formObjects[index - 2]));

	                                      }
	                                     
	                                  }
	                                  else
	                                  {
	                                      containerTop = $($formObjects[index - 1]).offset().top;
	                                      if (e.pageY <= containerTop) {
	                                          $empty.insertBefore($($formObjects[index - 1]));
	                                      }

	                                      
	                                  }
	                                  break;
	                              }

	                          }
	                      },
	                      out: function () {
	                          if (beginMove) {
	                              $("div.fb-form-object-editable").popover('hide');
	                              beginMove = false;
	                          }
	                          return $(element).find('.empty').remove();
	                      },
	                      up: function (e, isHover, draggable) {
	                          var formObject, newIndex, oldIndex;
	                          beginMove = true;
	                          if (!$drag.isMouseMoved()) {
	                              $(element).find('.empty').remove();
	                              return;
	                          }
	                          if (!isHover && draggable.mode === 'drag') {
	                              formObject = draggable.object.formObject;
	                              if (formObject.editable) {
	                                //  $builder.removeFormObject(attrs.fbBuilder, formObject.index);
	                              }
	                          } else if (isHover) {

	                              
	                              if (draggable.mode === 'mirror') {
	                                  //drag an element from component area
	                                //  if ($(draggable.element).find(".DropableDesign").length > 0)
	                                 //     app.isMirrorDrop = true;
	                                  $builder.insertFormObject(scope.formName, $(element).find('.empty').index(), {
	                                      component: draggable.object.componentName
	                                  });
	                              }

	                              if (draggable.mode === 'drag') {
	                                  //if it is move 
	                                  formObject = draggable.object.formObject;
	                                  var newFormObjectID, oldFormObjectID;
	                                    var idParts = formObject.id.split("-");
	                                    //id alwasy is formname-component name-randon number
	                                    //so remove the last two elements will give you the form name
	                                    var formNameParts = idParts;
	                                    var elementNameParts = formNameParts.splice(-2, 2)
	                                    var oldFormName = formNameParts.join("-");
	                                    //if (oldFormName === scope.formName) {
	                                    //    console.error("origin and destination form are the same as " + oldFormName + ". Abort")
	                                    //    return;
	                                    //}
	                                    newIdParts=[];
	                                    newIdParts.push(scope.formName);
	                                    newIdParts.push(elementNameParts.join("-"))
	                                   
	                                   
	                                    newFormObjectID = newIdParts.join("-");
	                                    oldFormObjectID = formObject.id;
	                                    changePropertyName = function (obj,searchString,subString) {
	                                        angular.forEach(obj, function (value, key, thisobj) {
	                                            if (value.id.indexOf(searchString) > -1)
	                                            {
	                                                var oldid = value.id;
	                                                var newid = value.id.replace(searchString, subString);
	                                                value.id = newid;                                              
	                                                //if this component is container, loop
	                                                if (value.isContainer)
	                                                {
	                                                    $builder.forms[newid] = $builder.forms[oldid];
	                                                    delete $builder.forms[oldid];
	                                                    changePropertyName($builder.forms[newid], oldid, newid);
	                                                }
	                                                
	                                            }
	                                        });
	                                    };
	                                    if (newFormObjectID !== oldFormObjectID)
	                                        {
	                                        formObject.id = newFormObjectID;
	                                        var currentElementIsContainer = formObject.isContainer;
	                                        if (currentElementIsContainer && $builder.forms[oldFormObjectID]) {
	                                            $builder.forms[newFormObjectID] = $builder.forms[oldFormObjectID];
	                                            delete $builder.forms[oldFormObjectID];
	                                            changePropertyName($builder.forms[newFormObjectID], oldFormObjectID, newFormObjectID);
	                                        }
	                                    }
	                                        

	                                    newIndex = $(element).find('.empty').index();
	                                    
	                                      $builder.removeFormObject(oldFormName, formObject.index);
	                                      $builder.insertFormObject(scope.formName, newIndex, formObject);
	                                       
	                                
	                              }
	                              return $(element).find('.empty').remove();
	                          }
	                          
	                      }
	                  });*/

	              }
	          };
	      }
	    ]);

	    directives.directive('fbFormObjectEditable', [
	      '$injector', function ($injector) {
	          var $builder, $compile, $drag, $validator;
	          $builder = $injector.get('$builder');
	          $drag = $injector.get('$drag');
	          $compile = $injector.get('$compile');
	          $validator = $injector.get('$validator');
	          return {
	              restrict: 'A',
	              controller: 'fbFormObjectEditableController',
	              scope: {
	                  formObject: '=fbFormObjectEditable'
	              },
	              link: function (scope, element) {
	                  var popover;
	                  scope.inputArray = [];
	                  scope.$component = $builder.components[scope.formObject.component];
	                  scope.setupScope(scope.formObject);
	                  scope.$watch('$component.template', function (template) {
	                      var view;
	                      if (!template) {
	                          return;
	                      }
	                      view = $compile(template)(scope);
	                      return $(element).html(view);
	                  });
	                  $(element).on('click', function () {
	                      return false;
	                  });
	                  $drag.draggable($(element), {
	                      object: {
	                          formObject: scope.formObject
	                      }
	                  });
	                  if (!scope.formObject.editable) {
	                      return;
	                  }
	                  popover = {};
	                  scope.$watch('$component.popoverTemplate', function (template) {
	                      if (!template) {
	                          return;
	                      }
	                      $(element).removeClass(popover.id);
	                      popover = {
	                          id: "fb-" + (Math.random().toString().substr(2)),
	                          isClickedSave: false,
	                          view: null,
	                          html: template
	                      };
	                      popover.html = $(popover.html).addClass(popover.id);
	                      popover.view = $compile(popover.html)(scope);
	                      $(element).addClass(popover.id);
	                      return $(element).popover({
	                          html: true,
	                          title: scope.$component.label,
	                          content: popover.view,
	                          container: 'body',
	                          placement: $builder.config.popoverPlacement
	                      });
	                  });
	                  scope.popover = {//save?
	                      save: function ($event) {

	                          /*
	                          The save event of the popover.
	                           */
	                          $event.preventDefault();
	                          $validator.validate(scope).success(function () {
	                              popover.isClickedSave = true;
	                              return $(element).popover('hide');
	                          });
	                      },
	                      remove: function ($event) {

	                          /*
	                          The delete event of the popover.
	                           */
	                          $event.preventDefault();
	                          $builder.removeFormObject(scope.$parent.formName, scope.$parent.$index);
	                          $(element).popover('hide');
	                      },
	                      shown: function () {

	                          /*
	                          The shown event of the popover.
	                           */
	                          scope.data.backup();
	                          return popover.isClickedSave = false;
	                      },
	                      cancel: function ($event) {

	                          /*
	                          The cancel event of the popover.
	                           */
	                          scope.data.rollback();
	                          if ($event) {
	                              $event.preventDefault();
	                              $(element).popover('hide');
	                          }
	                      }
	                  };
	                  $(element).on('show.bs.popover', function (e) {
	                      var $popover, elementOrigin, popoverTop;
	                      e.stopPropagation();
	                      if ($drag.isMouseMoved()) {
	                          return false;
	                      }
	                      $("div.fb-form-object-editable:not(." + popover.id + ")").popover('hide');
	                      $popover = $("form." + popover.id).closest('.popover');
	                      if ($popover.length > 0) {
	                          elementOrigin = $(element).offset().top + $(element).height() / 2;
	                          popoverTop = elementOrigin - $popover.height() / 2;
	                          $popover.css({
	                              position: 'absolute',
	                              top: popoverTop
	                          });
	                          $popover.show();
	                          setTimeout(function () {
	                              $popover.addClass('in');
	                              return $(element).triggerHandler('shown.bs.popover');
	                          }, 0);
	                          return false;
	                      }
	                  });
	                  $(element).on('shown.bs.popover', function (e) {
	                     // e.stopPropagation();
	                      $(".popover ." + popover.id + " input:first").select();
	                      scope.$apply(function () {
	                          return scope.popover.shown();
	                      });
	                  });
	                  return $(element).on('hide.bs.popover', function () {
	                      var $popover;
	                      $popover = $("form." + popover.id).closest('.popover');
	                      if (!popover.isClickedSave) {
	                          if (scope.$$phase || scope.$root.$$phase) {
	                              scope.popover.cancel();
	                          } else {
	                              scope.$apply(function () {
	                                  return scope.popover.cancel();
	                              });
	                          }
	                      }
	                      $popover.removeClass('in');
	                      setTimeout(function () {
	                          return $popover.hide();
	                      }, 300);
	                      return false;
	                  });
	              }
	          };
	      }
	    ]);

	    directives.directive('fbComponents', function () {
	        return {
	            restrict: 'A',
	            template: "<ul ng-if=\"groups.length > 1\" class=\"nav nav-tabs nav-justified\">\n    <li ng-repeat=\"group in groups\" ng-class=\"{active:activeGroup==group}\">\n        <a href='#' ng-click=\"selectGroup($event, group)\">{{group}}</a>\n    </li>\n</ul>\n<div class='form-horizontal'>\n    <div class='fb-component' ng-repeat=\"component in components\"\n        fb-component=\"component\"></div>\n</div>",
	            controller: 'fbComponentsController'
	        };
	    }).directive('fbComponent', [
	      '$injector', function ($injector) {
	          var $builder, $compile, $drag;
	          $builder = $injector.get('$builder');
	          $drag = $injector.get('$drag');
	          $compile = $injector.get('$compile');
	          return {
	              restrict: 'A',
	              scope: {
	                  component: '=fbComponent'
	              },
	              controller: 'fbComponentController',
	              link: function (scope, element) {
	                  scope.copyObjectToScope(scope.component);
	                  $drag.draggable($(element), {
	                      mode: 'mirror',
	                      defer: false,
	                      object: {
	                          componentName: scope.component.name
	                      }
	                  });
	                  return scope.$watch('component.template', function (template) {
	                      var view;
	                      if (!template) {
	                          return;
	                      }
	                      view = $compile(template)(scope);
	                      return $(element).html(view);
	                  });
	              }
	          };
	      }
	    ]).directive('fbForm', [
	      '$injector', function ($injector) {
	          return {
	              restrict: 'A',
	              require: 'ngModel',
	              scope: {
	                  formName: '@fbForm',
	                  input: '=ngModel',
	                  "default": '=fbDefault'
	              },
	              template: "<div class='fb-form-object' ng-repeat=\"object in form\" fb-form-object=\"object\"></div>",
	              controller: 'fbFormController',
	              link: function (scope, element, attrs) {
	                  var $builder, _base, _name;
	                  $builder = $injector.get('$builder');
	                  if ((_base = $builder.forms)[_name = scope.formName] == null) {
	                      _base[_name] = [];
	                  }
	                  return scope.form = $builder.forms[scope.formName];
	              }
	          };
	      }
	    ]);

	    directives.directive('fbFormObject', [
	    '$injector', function ($injector) {
	        var $builder, $compile, $parse;
	        $builder = $injector.get('$builder');
	        $compile = $injector.get('$compile');
	        $parse = $injector.get('$parse');
	        return {
	            restrict: 'A',
	            controller: 'fbFormObjectController',
	            link: function (scope, element, attrs) {
	                scope.formObject = $parse(attrs.fbFormObject)(scope);
	                scope.$component = $builder.components[scope.formObject.component];
	                scope.$on($builder.broadcastChannel.updateInput, function () {
	                    return scope.updateInput(scope.inputText);
	                });
	                if (scope.$component.arrayToText) {
	                    scope.inputArray = [];
	                    scope.$watch('inputArray', function (newValue, oldValue) {
	                        var checked, index, _ref;
	                        if (newValue === oldValue) {
	                            return;
	                        }
	                        checked = [];
	                        for (index in scope.inputArray) {
	                            if (scope.inputArray[index]) {
	                                checked.push((_ref = scope.options[index]) != null ? _ref : scope.inputArray[index]);
	                            }
	                        }
	                        return scope.inputText = checked.join(', ');
	                    }, true);
	                }
	                scope.$watch('inputText', function () {
	                    return scope.updateInput(scope.inputText);
	                });
	                scope.$watch(attrs.fbFormObject, function () {
	                    return scope.copyObjectToScope(scope.formObject);
	                }, true);
	                scope.$watch('$component.template', function (template) {
	                    var $input, $template, view;
	                    if (!template) {
	                        return;
	                    }
	                    $template = $(template);
	                    $input = $template.find("[ng-model='inputText']");
	                    $input.attr({
	                        validator: '{{validation}}'
	                    });
	                    view = $compile($template)(scope);
	                    return $(element).html(view);
	                });
	                if (!scope.$component.arrayToText && scope.formObject.options.length > 0) {
	                    scope.inputText = scope.formObject.options[0];
	                }
	                return scope.$watch("default['" + scope.formObject.id + "']", function (value) {
	                    if (!value) {
	                        return;
	                    }
	                    if (scope.$component.arrayToText) {
	                        return scope.inputArray = value;
	                    } else {
	                        return scope.inputText = value;
	                    }
	                });
	            }
	        };
	    }
	    ]);

	}).call(this);

	(function () {
	    angular.module('builder.drag', []).provider('$drag', function () {
	        var $injector, $rootScope, delay;
	        $injector = null;
	        $rootScope = null;
	        this.data = {
	            draggables: {},
	            droppables: {}
	        };
	        this.mouseMoved = false;
	        this.mx = 0;
	        this.my = 0;

	        this.isMouseMoved = (function (_this) {
	            return function () {
	                return _this.mouseMoved;
	            };
	        })(this);
	        this.hooks = {
	            down: {},
	            move: {},
	            up: {}
	        };
	        this.eventMouseMove = function () { };
	        this.eventMouseUp = function () { };
	        $((function (_this) {
	            return function () {
	                $(document).on('mousedown', function (e) {
	                    var func, key, _ref;
	                    _this.mouseMoved = false;
	                    _ref = _this.hooks.down;
	                    for (key in _ref) {
	                        func = _ref[key];
	                        func(e);
	                    }
	                });
	                $(document).on('mousemove', function (e) {
	                    if (e.pageX == _this.mx && e.pageY == _this.my)
	                        return;
	                    _this.mx = e.pageX;
	                    _this.my = e.pageY;

	                    var func, key, _ref;
	                    _this.mouseMoved = true;
	                    _ref = _this.hooks.move;
	                    for (key in _ref) {
	                        func = _ref[key];
	                        func(e);
	                    }
	                });
	                return $(document).on('mouseup', function (e) {
	                    var func, key, _ref;
	                    _ref = _this.hooks.up;
	                    for (key in _ref) {
	                        func = _ref[key];
	                        func(e);
	                    }
	                });
	            };
	        })(this));
	        this.currentId = 0;
	        this.getNewId = (function (_this) {
	            return function () {
	                return "" + (_this.currentId++);
	            };
	        })(this);
	        this.setupEasing = function () {
	            return jQuery.extend(jQuery.easing, {
	                easeOutQuad: function (x, t, b, c, d) {
	                    return -c * (t /= d) * (t - 2) + b;
	                }
	            });
	        };
	        this.setupProviders = function (injector) {

	            /*
	            Setup providers.
	             */
	            $injector = injector;
	            return $rootScope = $injector.get('$rootScope');
	        };
	        this.checkHover = (function (_this) {
	            return function ($elementA, $elementB) {

	                /*
	                Is element A hover on element B?
	                @param $elementA: jQuery object
	                @param $elementB: jQuery object
	                 */

	                /*
	                if element B has nested formbuilder, 
	                "cave out" that area;
	                */


	                var isHover, offsetA, offsetB, sizeA, sizeB;
	                offsetA = $elementA.offset();
	                offsetB = $elementB.offset();
	                sizeA = {
	                    width: $elementA.width(),
	                    height: $elementA.height()
	                };
	                sizeB = {
	                    width: $elementB.width(),
	                    height: $elementB.height()
	                };
	                isHover = {
	                    x: false,
	                    y: false
	                };

	                isHover.x = offsetA.left > offsetB.left && offsetA.left < offsetB.left + sizeB.width;
	                isHover.x = isHover.x || offsetA.left + sizeA.width > offsetB.left && offsetA.left + sizeA.width < offsetB.left + sizeB.width;



	                if (!isHover) {
	                    return false;
	                }

	                isHover.y = offsetA.top > offsetB.top && offsetA.top < offsetB.top + sizeB.height;
	                isHover.y = isHover.y || offsetA.top + sizeA.height > offsetB.top && offsetA.top + sizeA.height < offsetB.top + sizeB.height;
	                return isHover.x && isHover.y;
	            };
	        })(this);
	        
	        this.isHover = (function (_this) {
	            return function ($elementA, $elementB) {

	                /*
	                Is element A hover on element B?
	                @param $elementA: jQuery object
	                @param $elementB: jQuery object
	                 */

	                /*
	                if element B has nested formbuilder, 
	                "cave out" that area;
	                */


	                //if any of the child container is hovered over, return false
	                childContainers = $elementB.find(".fb-builder");
	                
	                for (i = 0; i < childContainers.length; i++) {
	                    childContainer = $(childContainers[i]);
	                    targetFormName = childContainer.attr("fb-builder");
	                    elementAContainers = $elementA.find(".fb-builder");
	                    //if the currnet moving clone has containers, only get the outer most(the first) container
	                    if (elementAContainers.length > 0)
	                    {
	                        dragFormName = elementAContainers.first().attr("fb-builder");
	                        //if target and clone match,it is not hover over as it is hover over itself
	                        if (dragFormName === targetFormName)
	                            continue;
	                    }

	                    isHoverChildContainer = _this.checkHover($elementA, childContainer);
	                    if (isHoverChildContainer)
	                        return false;
	                }

	                
	               
	                return _this.checkHover($elementA, $elementB);
	            };
	        })(this);
	        delay = function (ms, func) {
	            return setTimeout(function () {
	                return func();
	            }, ms);
	        };
	        this.autoScroll = {
	            up: false,
	            down: false,
	            scrolling: false,
	            scroll: (function (_this) {
	                return function () {
	                    _this.autoScroll.scrolling = true;
	                    if (_this.autoScroll.up) {
	                        $('html, body').dequeue().animate({
	                            scrollTop: $(window).scrollTop() - 50
	                        }, 100, 'easeOutQuad');
	                        return delay(100, function () {
	                            return _this.autoScroll.scroll();
	                        });
	                    } else if (_this.autoScroll.down) {
	                        $('html, body').dequeue().animate({
	                            scrollTop: $(window).scrollTop() + 50
	                        }, 100, 'easeOutQuad');
	                        return delay(100, function () {
	                            return _this.autoScroll.scroll();
	                        });
	                    } else {
	                        return _this.autoScroll.scrolling = false;
	                    }
	                };
	            })(this),
	            start: (function (_this) {
	                return function (e) {
	                    if (e.clientY < 50) {
	                        _this.autoScroll.up = true;
	                        _this.autoScroll.down = false;
	                        if (!_this.autoScroll.scrolling) {
	                            return _this.autoScroll.scroll();
	                        }
	                    } else if (e.clientY > $(window).innerHeight() - 50) {
	                        _this.autoScroll.up = false;
	                        _this.autoScroll.down = true;
	                        if (!_this.autoScroll.scrolling) {
	                            return _this.autoScroll.scroll();
	                        }
	                    } else {
	                        _this.autoScroll.up = false;
	                        return _this.autoScroll.down = false;
	                    }
	                };
	            })(this),
	            stop: (function (_this) {
	                return function () {
	                    _this.autoScroll.up = false;
	                    return _this.autoScroll.down = false;
	                };
	            })(this)
	        };
	        this.dragMirrorMode = (function (_this) {
	            return function ($element, defer, object) {
	                var result;
	                if (defer == null) {
	                    defer = true;
	                }
	                result = {
	                    id: _this.getNewId(),
	                    mode: 'mirror',
	                    maternal: $element[0],
	                    element: null,
	                    object: object
	                };
	                $element.on('mousedown', function (e) {
	                    var $clone;
	                    e.preventDefault();
	                    $clone = $element.clone();
	                    result.element = $clone[0];
	                    $clone.addClass("fb-draggable form-horizontal prepare-dragging");
	                    _this.hooks.move.drag = function (e, defer) {
	                        var droppable, id, _ref, _results;
	                        if ($clone.hasClass('prepare-dragging')) {
	                            $clone.css({
	                                width: $element.width(),
	                                height: $element.height()+42
	                            });
	                            $clone.removeClass('prepare-dragging');
	                            $clone.addClass('dragging');
	                            if (defer) {
	                                return;
	                            }
	                        }
	                        $clone.offset({
	                            left: e.pageX - $clone.width() / 2,
	                            top: e.pageY - $clone.height() / 2
	                        });
	                        _this.autoScroll.start(e);
	                        _ref = _this.data.droppables;
	                        _results = [];
	                        for (id in _ref) {
	                            droppable = _ref[id];
	                            if (_this.isHover($clone, $(droppable.element))) {
	                                _results.push(droppable.move(e, result));
	                            } else {
	                                _results.push(droppable.out(e, result));
	                            }
	                        }
	                        return _results;
	                    };
	                    _this.hooks.up.drag = function (e) {
	                        var droppable, id, isHover, _ref;
	                        _ref = _this.data.droppables;
	                        for (id in _ref) {
	                            droppable = _ref[id];
	                            isHover = _this.isHover($clone, $(droppable.element));
	                            droppable.up(e, isHover, result);
	                        }
	                        delete _this.hooks.move.drag;
	                        delete _this.hooks.up.drag;
	                        result.element = null;
	                        $clone.remove();
	                        return _this.autoScroll.stop();
	                    };
	                    $('body').append($clone);
	                    if (!defer) {
	                        return _this.hooks.move.drag(e, defer);
	                    }
	                });
	                return result;
	            };
	        })(this);
	        this.dragDragMode = (function (_this) {
	            return function ($element, defer, object) {
	                var result;
	                if (defer == null) {
	                    defer = true;
	                }
	                result = {
	                    id: _this.getNewId(),
	                    mode: 'drag',
	                    maternal: null,
	                    element: $element[0],
	                    object: object
	                };
	                $element.addClass('fb-draggable');
	                $element.on('mousedown', function (e) {
	                    e.preventDefault();
	                   //changed so can drag from inside the container
	                    if ($element.hasClass('dragging') || $element.find(".prepare-dragging").length) {
	                        return;
	                    }
	                    $element.addClass('prepare-dragging');
	                    _this.hooks.move.drag = function (e, defer) {
	                        var droppable, id, _ref;
	                        if ($element.hasClass('prepare-dragging')) {
	                            $element.css({
	                                width: $element.width(),
	                                height: $element.height()+42
	                            });
	                            $element.removeClass('prepare-dragging');
	                            $element.addClass('dragging');
	                            if (defer) {
	                                return;
	                            }
	                        }
	                        $element.offset({
	                            left: e.pageX - $element.width() / 2,
	                            top: e.pageY - $element.height() / 2
	                        });
	                        _this.autoScroll.start(e);
	                        _ref = _this.data.droppables;
	                        for (id in _ref) {
	                            droppable = _ref[id];
	                            if (_this.isHover($element, $(droppable.element))) {
	                                droppable.move(e, result);

	                            } else {
	                                droppable.out(e, result);
	                            }
	                        }
	                    };
	                    _this.hooks.up.drag = function (e) {
	                        var droppable, id, isHover, _ref;
	                        _ref = _this.data.droppables;
	                        for (id in _ref) {
	                            droppable = _ref[id];
	                            isHover = _this.isHover($element, $(droppable.element));
	                            //if move inside the same container, just move
	                            //if in or out of the current container, remove from the current, add to the new container
	                            droppable.up(e, isHover, result);
	                        }
	                        delete _this.hooks.move.drag;
	                        delete _this.hooks.up.drag;
	                        $element.css({
	                            width: '',
	                            height: '',
	                            left: '',
	                            top: ''
	                        });
	                        $element.removeClass('dragging defer-dragging');
	                        return _this.autoScroll.stop();
	                    };
	                    if (!defer) {
	                        return _this.hooks.move.drag(e, defer);
	                    }
	                });
	                return result;
	            };
	        })(this);
	        this.dropMode = (function (_this) {//最后捕捉到行成功添加处
	            return function ($element, options) {
	                var result;
	                result = {
	                    id: _this.getNewId(),
	                    element: $element[0],
	                    move: function (e, draggable) {
	                        return $rootScope.$apply(function () {
	                            return typeof options.move === "function" ? options.move(e, draggable) : void 0;
	                        });
	                    },
	                    up: function (e, isHover, draggable) {
	                        return $rootScope.$apply(function () {
	                            return typeof options.up === "function" ? options.up(e, isHover, draggable) : void 0;
	                        });
	                    },
	                    out: function (e, draggable) {
	                        return $rootScope.$apply(function () {
	                            return typeof options.out === "function" ? options.out(e, draggable) : void 0;
	                        });
	                    }
	                };
	                return result;
	            };
	        })(this);
	        this.draggable = (function (_this) {
	            return function ($element, options) {
	                var draggable, element, result, _i, _j, _len, _len1;
	                if (options == null) {
	                    options = {};
	                }

	                /*
	                Make the element could be drag.
	                @param element: The jQuery element.
	                @param options: Options
	                    mode: 'drag' [default], 'mirror'
	                    defer: yes/no. defer dragging
	                    object: custom information
	                 */
	                result = [];
	                if (options.mode === 'mirror') {
	                    for (_i = 0, _len = $element.length; _i < _len; _i++) {
	                        element = $element[_i];
	                        draggable = _this.dragMirrorMode($(element), options.defer, options.object);
	                        result.push(draggable.id);
	                        _this.data.draggables[draggable.id] = draggable;
	                    }
	                } else {
	                    for (_j = 0, _len1 = $element.length; _j < _len1; _j++) {
	                        element = $element[_j];
	                        draggable = _this.dragDragMode($(element), options.defer, options.object);
	                        result.push(draggable.id);
	                        _this.data.draggables[draggable.id] = draggable;
	                    }
	                }
	                return result;
	            };
	        })(this);
	        this.droppable = (function (_this) {
	            return function ($element, options) {
	                var droppable, element, result, _i, _len;
	                if (options == null) {
	                    options = {};
	                }

	                /*
	                Make the element coulde be drop.
	                @param $element: The jQuery element.
	                @param options: The droppable options.
	                    move: The custom mouse move callback. (e, draggable)->
	                    up: The custom mouse up callback. (e, isHover, draggable)->
	                    out: The custom mouse out callback. (e, draggable)->
	                 */
	                result = [];
	                for (_i = 0, _len = $element.length; _i < _len; _i++) {
	                    element = $element[_i];

	                   // if (!element.classList.contains("DropableDesign") || app.isMirrorDrop) {
	                        droppable = _this.dropMode($(element), options);
	                        result.push(droppable);
	                        _this.data.droppables[droppable.id] = droppable;
	                       // app.isMirrorDrop = false;
	                   // }
	                }
	                return result;
	            };
	        })(this);
	        this.get = function ($injector) {
	            this.setupEasing();
	            this.setupProviders($injector);
	            return {
	                isMouseMoved: this.isMouseMoved,
	                data: this.data,
	                draggable: this.draggable,
	                droppable: this.droppable
	            };
	        };
	        this.get.$inject = ['$injector'];
	        this.$get = this.get;
	    });

	}).call(this);

	(function () {
	    angular.module('builder', ['builder.directive']);

	}).call(this);


	/*
	    component:
	        It is like a class.
	        The base components are textInput, textArea, select, check, radio.
	        User can custom the form with components.
	    formObject:
	        It is like an object (an instance of the component).
	        User can custom the label, description, required and validation of the input.
	    form:
	        This is for end-user. There are form groups int the form.
	        They can input the value to the form.
	 */

	(function () {
	    var __indexOf = [].indexOf || function (item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };

	    angular.module('builder.provider', []).provider('$builder', function () {
	        var $http, $injector, $templateCache;
	        $injector = null;
	        $http = null;
	        $templateCache = null;
	        this.config = {
	            popoverPlacement: 'right'
	        };
	        this.components = {};
	        this.groups = [];
	        this.broadcastChannel = {
	            updateInput: '$updateInput'
	        };
	        this.forms = {
	            "default": []
	        };
	        this.convertComponent = function (name, component) {
	            var result, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9,_ref10,_ref11,_ref12,_ref13,_ref14;
	            result = {
	                name: name,
	                group: (_ref = component.group) != null ? _ref : 'Default',
	                label: (_ref1 = component.label) != null ? _ref1 : '',
	                description: (_ref2 = component.description) != null ? _ref2 : '',
	                placeholder: (_ref3 = component.placeholder) != null ? _ref3 : '',
	                editable: (_ref4 = component.editable) != null ? _ref4 : true,
	                required: (_ref5 = component.required) != null ? _ref5 : false,
	                validation: (_ref6 = component.validation) != null ? _ref6 : '/.*/',
	                validationOptions: (_ref7 = component.validationOptions) != null ? _ref7 : [],
	                options: (_ref8 = component.options) != null ? _ref8 : [],
	                arrayToText: (_ref9 = component.arrayToText) != null ? _ref9 : false,
	                template: component.template,
	                templateUrl: component.templateUrl,
	                popoverTemplate: component.popoverTemplate,
	                popoverTemplateUrl: component.popoverTemplateUrl,
	                isContainer: (_ref10 = component.isContainer) != null ? _ref10 : false,
	                templateOptions: (_ref11 = component.templateOptions) != null ? _ref11 : {},
	                expressionProperties: (_ref12 = component.expressionProperties) != null ? _ref12 : "",
	                noFormControl: (_ref13 = component.noFormControl)!=null?_ref13:true,
	                userinfo:  (_ref14 = component.userinfo) != null ? _ref14 : ""
	            };
	            if (!result.template && !result.templateUrl) {
	                console.error("The template is empty.");
	            }
	            if (!result.popoverTemplate && !result.popoverTemplateUrl) {
	                console.error("The popoverTemplate is empty.");
	            }
	            return result;
	        };
	        this.convertFormObject = function (name, formObject) {
	            var component, result, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12,_ref14;
	          
	            if (formObject == null) {
	                formObject = {};
	            }
	            component = this.components[formObject.component];
	            //console.log(component);
	            if (component == null) {
	                throw "The component " + formObject.component + " was not registered.";
	            }
	            var _newId=name.concat("-" + formObject.component).concat("-" + Math.floor(Math.random() * 9999));
	            result = {
	                key: formObject.key,
	                component: formObject.component,
	                editable: (_ref = formObject.editable) != null ? _ref : component.editable,
	                index: (_ref1 = formObject.index) != null ? _ref1 : 0,
	                label: (_ref2 = formObject.label) != null ? _ref2 : component.label,
	                description: (_ref3 = formObject.description) != null ? _ref3 : component.description,
	                placeholder: (_ref4 = formObject.placeholder) != null ? _ref4 : component.placeholder,
	                options: (_ref5 = formObject.options) != null ? _ref5 : component.options,
	                required: (_ref6 = formObject.required) != null ? _ref6 : component.required,
	                validation: (_ref7 = formObject.validation) != null ? _ref7 : component.validation,
	                id: (_ref9 = formObject.id) != null ? _ref9 : _newId,
	                isContainer: (_ref8 = formObject.isContainer) != null ? _ref8 : component.isContainer,
	                templateOptions: (_ref10 = formObject.templateOptions) != null ? _ref10 : component.templateOptions,
	                expressionProperties: (_ref11 = formObject.expressionProperties) != null ? _ref11 : component.expressionProperties,
	                noFormControl: (_ref12 = formObject.noFormControl) != null ? _ref12 : component.noFormControl,
	                userinfo: (_ref14 = formObject.userinfo) != null ? _ref14 : component.userinfo
	                
	               
	            };
	            return result;
	        };
	        this.reindexFormObject = (function (_this) {
	            return function (name) {
	                var formObjects, index, _i, _ref;
	                formObjects = _this.forms[name];
	                for (index = _i = 0, _ref = formObjects.length; _i < _ref; index = _i += 1) {
	                    //TODO: should be fixed from the source, where those extra components came from
	                    if (formObjects[index]) 
	                        formObjects[index].index = index;
	                    else
	                        _this.removeFormObject(name, index);
	                    //END TODO
	                }
	            };
	        })(this);
	        this.setupProviders = (function (_this) {
	            return function (injector) {
	                $injector = injector;
	                $http = $injector.get('$http');
	                return $templateCache = $injector.get('$templateCache');
	            };
	        })(this);
	        this.loadTemplate = function (component) {

	            /*
	            Load template for components.
	            @param component: {object} The component of $builder.
	             */
	            if (component.template == null) {
	                $http.get(component.templateUrl, {
	                    cache: $templateCache
	                }).success(function (template) {
	                     return component.template = template;
	                });
	            }
	            if (component.popoverTemplate == null) {
	                 $http.get(component.popoverTemplateUrl, {
	                    cache: $templateCache
	                }).success(function (template) {
	                    component.popoverTemplate = template;
	                    //add shared component elements for all components such as the cancel button and 
	                    return loadPopoverSharedElements(component);
	                });
	            }
	            else {
	                return loadPopoverSharedElements(component);
	            }
	            
	        };
	       loadPopoverSharedElements = function (component)
	       {
	           var originalHTML = component.popoverTemplate;
	           var $originalHTML = $('<div />', { html: originalHTML });
	           if (component.noFormControl)
	               {
	            $originalHTML.find("form").children().first().prepend("<div class='form-group'><label class='control-label'>Key</label><input type='text' ng-model='key' class='form-control' /></div>");
	           }
	           $originalHTML.find("form").children(".form-group").last().after("<div class='form-group'><label class='control-label'>Validation Expression</label><input type='text' ng-model='expressionProperties' class='form-control' /><p class='help-block'>Example:&quot;hide&quot;:&quot;model.myDate===''&quot;</p></div>" + "<div class='form-group'><label class='control-label'>SharePoint List Field Name</label><input type='text' ng-model='templateOptions.listFieldName' class='form-control' /><p class='help-block'>if you want to push this field value to the target SharePoint list, specify the field name here</p></div>");

	           $originalHTML.find("form").children().last().append("<hr /><div class='form-group'><input type='submit' ng-click='popover.save($event)' class='btn btn-primary' value='Save' /><input type='button' ng-click='popover.cancel($event)' class='btn btn-default' value='Cancel' /><input type='button' ng-click='popover.remove($event)' class='btn btn-danger' value='Delete' /></div>");
	            
	            var newHTML = $originalHTML.html();
	            return component.popoverTemplate = newHTML;
	           
	        };
	        this.registerComponent = (function (_this) {
	            return function (name, component) {
	                var newComponent, _ref;
	                if (component == null) {
	                    component = {};
	                }

	                /*
	                Register the component for form-builder.
	                @param name: The component name.
	                @param component: The component object.
	                    group: {string} The component group.
	                    label: {string} The label of the input.
	                    description: {string} The description of the input.
	                    placeholder: {string} The placeholder of the input.
	                    editable: {bool} Is the form object editable?
	                    required: {bool} Is the form object required?
	                    validation: {string} angular-validator. "/regex/" or "[rule1, rule2]". (default is RegExp(.*))
	                    validationOptions: {array} [{rule: angular-validator, label: 'option label'}] the options for the validation. (default is [])
	                    options: {array} The input options.
	                    arrayToText: {bool} checkbox could use this to convert input (default is no)
	                    template: {string} html template
	                    templateUrl: {string} The url of the template.
	                    popoverTemplate: {string} html template
	                    popoverTemplateUrl: {string} The url of the popover template.
	                 */
	                if (_this.components[name] == null) {
	                    newComponent = _this.convertComponent(name, component);
	                    _this.components[name] = newComponent;
	                    if ($injector != null) {
	                        _this.loadTemplate(newComponent);
	                    }
	                    if (_ref = newComponent.group, __indexOf.call(_this.groups, _ref) < 0) {
	                        _this.groups.push(newComponent.group);
	                    }
	                } else {
	                    console.error("The component " + name + " was registered.");
	                }
	            };
	        })(this);
	        this.addFormObject = (function (_this) {
	            return function (name, formObject) {
	                var _base;
	                //console.log(formObject);
	                if (formObject == null) {
	                    formObject = {};
	                }
	                //console.log(formObject);
	                /*
	                Insert the form object into the form at last.
	                 */
	                if ((_base = _this.forms)[name] == null) {
	                    _base[name] = [];
	                }
	                return _this.insertFormObject(name, _this.forms[name].length, formObject);
	            };
	        })(this);
	        this.insertFormObject = (function (_this) {
	            return function (name, index, formObject) {
	                var _base;
	                if (formObject == null) {
	                    formObject = {};
	                }
	                //console.log(formObject);
	                /*
	                Insert the form object into the form at {index}.
	                @param name: The form name.
	                @param index: The form object index.
	                @param form: The form object.
	                    id: The form object id.
	                    component: {string} The component name
	                    editable: {bool} Is the form object editable? (default is yes)
	                    label: {string} The form object label.
	                    description: {string} The form object description.
	                    placeholder: {string} The form object placeholder.
	                    options: {array} The form object options.
	                    required: {bool} Is the form object required? (default is no)
	                    validation: {string} angular-validator. "/regex/" or "[rule1, rule2]".
	                    [index]: {int} The form object index. It will be updated by $builder.
	                @return: The form object.
	                 */
	                if ((_base = _this.forms)[name] == null) {
	                    _base[name] = [];
	                }
	                if (index > _this.forms[name].length) {
	                    index = _this.forms[name].length;
	                } else if (index < 0) {
	                    index = 0;
	                }
	                _this.forms[name].splice(index, 0, _this.convertFormObject(name, formObject));
	                _this.reindexFormObject(name);
	                return _this.forms[name][index];
	            };
	        })(this);
	        this.removeFormObject = (function (_this) {
	            return function (name, index) {

	                /*
	                Remove the form object by the index.
	                @param name: The form name.
	                @param index: The form object index.
	                 */
	                var formObjects;
	                formObjects = _this.forms[name];
	                formObjects.splice(index, 1);
	                return _this.reindexFormObject(name);
	            };
	        })(this);
	        this.updateFormObjectIndex = (function (_this) {
	            return function (name, oldIndex, newIndex) {
	                //console.log(name); console.log(oldIndex); console.log(newIndex);
	                /*
	                Update the index of the form object.
	                @param name: The form name.
	                @param oldIndex: The old index.
	                @param newIndex: The new index.
	                 */
	                var formObject, formObjects;
	                if (oldIndex === newIndex) {
	                    return;
	                }
	                formObjects = _this.forms[name];
	                formObject = formObjects.splice(oldIndex, 1)[0];
	                formObjects.splice(newIndex, 0, formObject);
	                return _this.reindexFormObject(name);
	            };
	        })(this);
	        this.$get = [
	          '$injector', (function (_this) {
	              return function ($injector) {
	                  var component, name, _ref;
	                  _this.setupProviders($injector);
	                  _ref = _this.components;
	                  for (name in _ref) {
	                      component = _ref[name];
	                      _this.loadTemplate(component);
	                  }
	                  return {
	                      config: _this.config,
	                      components: _this.components,
	                      groups: _this.groups,
	                      forms: _this.forms,
	                      broadcastChannel: _this.broadcastChannel,
	                      registerComponent: _this.registerComponent,
	                      addFormObject: _this.addFormObject,
	                      insertFormObject: _this.insertFormObject,
	                      removeFormObject: _this.removeFormObject,
	                      updateFormObjectIndex: _this.updateFormObjectIndex
	                  };
	              };
	          })(this)
	        ];
	    });

	}).call(this);


/***/ },
/* 4 */
/***/ function(module, exports) {

	(function() {
	  angular.module('builder.components', ['builder', 'validator.rules']).config([
	    '$builderProvider', function($builderProvider) {
	      $builderProvider.registerComponent('textInput', {
	        group: '基本题型',
	        label: '填空题',
	        description: '描述信息',
	        placeholder: '请输入内容……',
	        required: false,
	        validationOptions: [
	          {
	            label: 'none',
	            rule: '/.*/'
	          }, {
	            label: 'number',
	            rule: '[number]'
	          }, {
	            label: 'email',
	            rule: '[email]'
	          }, {
	            label: 'url',
	            rule: '[url]'
	          }
	        ],
	        template: "<div class=\"Tool_item Tool_input\">\n  <label for=\"{{formName+index}}\" class=\"control-label\" ng-class=\"{'fb-required':required}\">\n    {{label}}\n   </label> <span class=\"noteInfo\">{{description}}</span>\n <input type=\"text\" class=\"form-control\" ng-model=\"inputText\" validator-group=\"{{formName}}\" validator-required=\"{{required}}\" id=\"{{formName+index}}\" placeholder=\"{{placeholder}}\">\n</div>\n",
	        popoverTemplate: "<form>\n    <div class=\"form-group\">\n        <label class='control-label'>Label</label>\n        <input type='text' ng-model=\"label\" validator=\"[required]\" class='form-control'/>\n    </div>\n    <div class=\"form-group\">\n        <label class='control-label'>Description</label>\n        <input type='text' ng-model=\"description\" class='form-control'/>\n    </div>\n    <div class=\"form-group\">\n        <label class='control-label'>Placeholder</label>\n        <input type='text' ng-model=\"placeholder\" class='form-control'/>\n    </div>\n    <div class=\"checkbox\">\n        <label>\n            <input type='checkbox' ng-model=\"required\" />\n            Required</label>\n    </div>\n    <div class=\"form-group\" ng-if=\"validationOptions.length > 0\">\n        <label class='control-label'>Validation</label>\n        <select ng-model=\"$parent.validation\" class='form-control' ng-options=\"option.rule as option.label for option in validationOptions\"></select>\n    </div>\n\n    </form>"
	      });

	      $builderProvider.registerComponent('textArea', {
	        group: '基本题型',
	        label: '简答题',
	        description: '描述信息',
	        placeholder: '请输入内容……',
	        required: false,

			//test1:"",
	        template: "<div class=\"Tool_item Tool_textarea\">\n  <label for=\"0\" class=\"control-label\" ng-class=\"{'fb-required':required}\">\n    {{label}}     \n </label> <span class=\"noteInfo\">{{description}}</span>\n  <textarea rows=\"3\" class=\"form-control\" ng-model=\"inputText\" ng-attr-placeholder=\"{{placeholder}}\"></textarea>\n</div>\n",
	        popoverTemplate: "<form>\n    <div class=\"form-group\">\n        <label class='control-label'>Label</label>\n        <input type='text' ng-model=\"label\" validator=\"[required]\" class='form-control'/>\n    </div>\n    <div class=\"form-group\">\n        <label class='control-label'>Description</label>\n        <input type='text' ng-model=\"description\" class='form-control'/>\n    </div>\n    <div class=\"form-group\">\n        <label class='control-label'>Placeholder</label>\n        <input type='text' ng-model=\"placeholder\" class='form-control'/>\n    </div>\n    <div class=\"checkbox\">\n        <label>\n            <input type='checkbox' ng-model=\"required\" />\n            Required</label>\n      </div>\n   \n\n    </form>"
	//<div class=\"form-group\">\n <label class='control-label'>Test1</label>\n        <input type='text' ng-model=\"test1\"  class='form-control'/>\n </div>
	      });
	      $builderProvider.registerComponent('checkbox', {
	        group: '基本题型',
	        label: '多选题',
	        description: '描述信息',
	        placeholder: '请输入内容……',
	        required: false,
	        options: ['项目一', '项目二','项目三'],
	        arrayToText: true,
	        template: "<div class=\"Tool_item Tool_checkbox\">\n  <label for=\"0\" class=\"control-label\" ng-class=\"{'fb-required':required}\">\n  {{label}}\n    </label>\n <span class=\"noteInfo\">{{description}}</span>\n <div class=\"mgT-6\"><div class=\"checkbox\" ng-repeat=\"item in options track by $index\">\n                <label><input checked=\"checked\" type=\"checkbox\" ng-model=\"$parent.inputArray[$index]\" value='item'/>\n                 <span>{{item}} </span>\n            </label>\n </div>\n</div></div>\n",
	        popoverTemplate: "<form>\n    <div class=\"form-group\">\n        <label class='control-label'>Label</label>\n        <input type='text' ng-model=\"label\" validator=\"[required]\" class='form-control'/>\n    </div>\n    <div class=\"form-group\">\n        <label class='control-label'>Description</label>\n        <input type='text' ng-model=\"description\" class='form-control'/>\n    </div>\n    <div class=\"form-group\">\n        <label class='control-label'>Options</label>\n        <textarea class=\"form-control\" rows=\"3\" ng-model=\"optionsText\"/>\n    </div>\n    <div class=\"checkbox\">\n        <label>\n            <input type='checkbox' ng-model=\"required\" />\n            Required\n        </label>\n    </div>\n\n    </form>"
	      });
	      $builderProvider.registerComponent('radio', {
	        group: '基本题型',
	        label: '单选',
	        description: '描述信息',
	        placeholder: '请输入内容……',
	        required: false,
	        options: ['项目一', '项目二'],
	        template: "<div class=\"Tool_item Tool_radio\">\n  <label for=\"0\" class=\"control-label\" ng-class=\"{'fb-required':required}\">\n    {{label}}\n    </label>\n <span class=\"noteInfo\">{{description}}</span>\n <div class=\"mgT-6\"><div class=\"radio\" ng-repeat=\"item in options track by $index\">\n                <label><input type=\"radio\" ng-model=\"$parent.inputText\" value='{{item}}'/>\n                <span>{{item}}</span>\n            </label>\n </div>\n</div></div>\n",
	        popoverTemplate: "<form>\n    <div class=\"form-group\">\n        <label class='control-label'>标题</label>\n        <input type='text' ng-model=\"label\" validator=\"[required]\" class='form-control'/>\n    </div>\n    <div class=\"form-group\">\n        <label class='control-label'>描述</label>\n        <input type='text' ng-model=\"description\" class='form-control'/>\n    </div>\n   <div class=\"form-group\">\n        <label class='control-label'>选项</label>\n        <textarea class=\"form-control\" rows=\"3\" ng-model=\"optionsText\"/>\n    </div>\n\n   <div class=\"checkbox\">\n        <label>\n            <input type='checkbox' ng-model=\"required\" />\n            是否必填\n        </label>\n    </div>\n\n     </form>"
	      });
	      // return $builderProvider.registerComponent('select', {
	      //   group: 'Default',
	      //   label: 'Select',
	      //   description: 'description',
	      //   placeholder: 'placeholder',
	      //   required: false,
	      //   options: ['value one', 'value two'],
	      //   template: "<div>\n  <label for=\"0\" class=\"control-label\">\n    {{label}}\n    {{fb-required ? '*' : ''}}\n  </label>\n<select ng-options=\"value for value in options\" id=\"{{formName+index}}\" class=\"form-control\"\n            ng-model=\"inputText\" ng-init=\"inputText = options[0]\"/>\n</div>\n",
	      //   popoverTemplate: "<form>\n    <div class=\"form-group\">\n        <label class='control-label'>Label</label>\n        <input type='text' ng-model=\"label\" validator=\"[required]\" class='form-control'/>\n    </div>\n    <div class=\"form-group\">\n        <label class='control-label'>Options</label>\n        <textarea class=\"form-control\" rows=\"3\" ng-model=\"optionsText\"/>\n    </div>\n\n   <div class=\"checkbox\"><label><input type='checkbox' ng-model=\"required\" />Required</label></div>  </form>"
	      // });
	    }
	  ]);

	}).call(this);


/***/ },
/* 5 */
/***/ function(module, exports) {

	(function() {
	    var builderapp=angular.module('formlyObj').run([
	      '$builder', function ($builder) { 
			  // $builder.registerComponent('radioFlat', {
	           //    group: 'Default',
	           //    label: 'radio inline',
	           //    required: false,
	           //    options: ['value one', 'value two'],
	          //
	           //    template: "<div>\r\n    <label for=\"{{formName+index}}\" class=\"control-label\">\r\n        {{label}}\r\n        {{fb-required ? \'*\' : \'\'}}\r\n    <\/label>\r\n    <div class=\"radio-group\">\r\n        <label class=\"radio-inline\" ng-repeat=\"item in options track by $index\">\r\n            <input type=\"radio\"\r\n                   id=\"{{id + \'_\'+ $index}}\"\r\n                   value=\"{{item}}\"\r\n                   ng-model=\"$parent.inputText\">\r\n            {{item}}\r\n        <\/label>\r\n\r\n    <\/div>\r\n<\/div>\r\n",
	          //
	           //    popoverTemplate: "<form>\r\n    <div class=\"form-group\">\r\n        <label class=\'control-label\'>Label<\/label>\r\n        <input type=\'text\' ng-model=\"label\"  class=\'form-control\' \/>\r\n    <\/div>\r\n   \r\n    <div class=\"form-group\">\r\n        <label class=\'control-label\'>Options<\/label>\r\n        <textarea class=\"form-control\" rows=\"3\" ng-model=\"optionsText\" \/>\r\n    <\/div>\r\n\r\n    \r\n<\/form>"
			  // });

			  $builder.registerComponent('multiField', {
			      group: '组合题型',
			      label: '组合题',
	              description: '描述信息',
	              placeholder: 'placeholder',
	              required: false,
			      template: "<div class=\"Tool_item Tool_multiField\"><div class=\"panel panel-default\" >\r\n    <div class=\"panel-heading\">\r\n        <label class=\"panel-title control-label \" ng-class=\"{'fb-required':required}\">{{label}}<\/label> <span class=\"noteInfo\">{{description}}</span> <\/div>\r\n    <div class=\"DropableDesign\" fb-builder=\"{{id}}\" \/>\r\n\r\n\r\n<\/div> </div>",

			      popoverTemplate: "<form>\r\n    <div class=\"form-group\">\r\n        <label class=\'control-label\'>Label<\/label>\r\n        <input type=\'text\' ng-model=\"label\"  class=\'form-control\' \/>\r\n    <\/div>\r\n   <div class=\"form-group\">\n        <label class='control-label'>Description</label>\n        <input type='text' ng-model=\"description\" class='form-control'/>\n    </div>\n \r\n    <div class=\"form-group\">\r\n        <label class=\'control-label\'>Options<\/label>\r\n        <textarea class=\"form-control\" rows=\"3\" ng-model=\"optionsText\" \/>\r\n    <\/div>\r\n\r\n <div class=\"checkbox\">\n        <label>\n            <input type='checkbox' ng-model=\"required\" />\n            Required</label>\n    </div>\n\n    \r\n<div class=\"checkbox\">\n        <label>\n            <input type='checkbox' ng-model=\"userinfo\" />\n            是否是用户信息</label>\n    </div>\n\n    \r\n<\/form>",
			      isContainer: true

			  });


			  // $builder.registerComponent('repeatSection', {
			  //     group: 'Advance',
			  //     label: 'repeat section',
	          //
			  //     template: "<div class=\"panel panel-default\" >\r\n    <div class=\"panel-heading\">\r\n        <h3 class=\"panel-title\">{{label}}<\/h3>\r\n    <\/div>\r\n    <div class=\"DropableDesign\" fb-builder=\"{{id}}\" \/>\r\n\r\n  \r\n    <p>\r\n        <button type=\"button\" class=\"btn btn-primary\">{{templateOptions.btnText}}<\/button>\r\n    <\/p>\r\n\r\n<\/div>",
	          //
			  //     popoverTemplate: "<form>\r\n    <div class=\"form-group\">\r\n        <label class=\'control-label\'>Label<\/label>\r\n        <input type=\'text\' ng-model=\"label\" validator=\"[required]\" class=\'form-control\'\/>\r\n    <\/div>\r\n    <div class=\"form-group\">\r\n        <label class=\'control-label\'>Description<\/label>\r\n        <input type=\'text\' ng-model=\"description\" class=\'form-control\'\/>\r\n    <\/div>\r\n    <div class=\"form-group\">\r\n        <label class=\'control-label\'>Placeholder<\/label>\r\n        <input type=\'text\' ng-model=\"placeholder\" class=\'form-control\'\/>\r\n    <\/div>\r\n    <div class=\"checkbox\">\r\n        <label>\r\n            <input type=\'checkbox\' ng-model=\"required\" \/>\r\n            Required<\/label>\r\n    <\/div>\r\n    <div class=\"form-group\" ng-if=\"validationOptions.length > 0\">\r\n        <label class=\'control-label\'>Validation<\/label>\r\n        <select ng-model=\"$parent.validation\" class=\'form-control\' ng-options=\"option.rule as option.label for option in validationOptions\"><\/select>\r\n    <\/div>\r\n\r\n    <hr\/>\r\n    <div class=\'form-group\'>\r\n        <input type=\'submit\' ng-click=\"popover.save($event)\" class=\'btn btn-primary\' value=\'Save\'\/>\r\n        <input type=\'button\' ng-click=\"popover.cancel($event)\" class=\'btn btn-default\' value=\'Cancel\'\/>\r\n        <input type=\'button\' ng-click=\"popover.remove($event)\" class=\'btn btn-danger\' value=\'Delete\'\/>\r\n    <\/div>\r\n<\/form>",
			  //     isContainer: true,
			  //     templateOptions:{btnText:"Add Another Section"}
			  // });
			  // $builder.registerComponent('datePicker', {
			  //     group: 'Advance',
			  //     template: "<div>\r\n    <label for=\"0\" class=\"control-label\">{{templateOptions.label}} {{fb-required ? \'*\' : \'\'}}<\/label>\r\n\r\n    <input type=\"text\" date-format=\"{{templateOptions.dateFormat}}\" id=\"{{id}}\" ng-model=\"date\" class=\"form-control\" placeholder=\"{{placeholder}}\" \/>\r\n\r\n<\/div>",
	          //
			  //     popoverTemplate: "<form>\r\n    <div class=\"form-group\">\r\n        <label class=\'control-label\'>Label<\/label>\r\n        <input type=\'text\' ng-model=\"templateOptions.label\" class=\'form-control\' \/>\r\n    <\/div>\r\n    <div class=\"form-group\">\r\n        <label class=\'control-label\'>Date Format<\/label>\r\n        <input type=\'text\' ng-model=\"templateOptions.dateFormat\" class=\'form-control\' \/>\r\n    <\/div>\r\n    <div class=\"form-group\">\r\n        <label class=\'control-label\'>Placeholder<\/label>\r\n        <input type=\'text\' ng-model=\"placeholder\" class=\'form-control\' \/>\r\n    <\/div>\r\n    <div class=\"checkbox\">\r\n        <label>\r\n            <input type=\'checkbox\' ng-model=\"required\" \/>\r\n            Required\r\n        <\/label>\r\n    <\/div>\r\n    \r\n<\/form>",
			  //     templateOptions: {
			  //         label: 'Date Picker',
			  //         dateFormat: "yy-mm-dd"
	          //
			  //     }
			  // });
			  // $builder.registerComponent('htmlContent', {
			  //     group: 'Default',
			  //     template: '<label for="0" class="control-label">   HTML Content </label><br/><div>{{templateOptions.htmlContent}}</div>',
	          //
			  //     popoverTemplate:"<form>\r\n    <div class=\"form-group\">\r\n        <label class=\'control-label\'>HTML Content<\/label>\r\n        <textarea ng-model=\"templateOptions.htmlContent\" class=\'form-control\' \/>\r\n    <\/div>\r\n\r\n    \r\n<\/form>",
			  //     noFormControl:false
			  // });
			 
	      }
	    ]);
	    
	}).call(this);


/***/ },
/* 6 */
/***/ function(module, exports) {

	angular.module('formlyObj').config(['formlyConfigProvider', 'formlyApiCheck', function (formlyConfigProvider, formlyApiCheck) {
	    formlyConfigProvider.setType({
	        name: 'multiField',
	       
	        // template: "<div class=\"row\"> <label>{{to.label}}</label></label><div formly-field ng-repeat=\"field in to.fields track by $index\" ng-if=\"!field.hide\" class=\"{{::colClass[$index]}}formly-field{{field.type ? 'formly-field-' + field.type : ''}}\" options=\"field\" model=\"model\" fields=\"fields\" form=\"form\" form-id=\"formId\" form-state=\"options.formState\" index=\"$index\"> </div></div>",
	        template: "<div> <label class=\"control-label\">{{to.label}} <span class=\"font-red\" ng-if=\"to.required\">*</span></label> <span class=\"noteInfo\">{{to.description}}</span> <div class=\"multiField_con clearfix form-group mgT-6\"><div formly-field ng-repeat=\"field in to.fields track by $index\" ng-if=\"!field.hide\" class=\"{{::colClass[$index]}}formly-field{{field.type ? 'formly-field-' + field.type : ''}}\" options=\"field\" model=\"model\" fields=\"fields\" form=\"form\" form-id=\"formId\" form-state=\"options.formState\" index=\"$index\"></div> </div></div>",

	        defaultOptions: {
	            noFormControl: true
	        }/*,
	      apiCheck: {
	        templateOptions: apiCheck.shape({
	          fields: apiCheck.arrayOf(formlyApiCheck.formlyFieldOptions)
	        })
	      }*/,
	        controller: function ($scope) {
	            // if ($scope.to.fields.length > 0) {
	            //     var averageWidth = Math.floor(12 / $scope.to.fields.length);
	            //     $scope.colClass = [];
	            //     var width;
	            //     angular.forEach($scope.to.fields, function (field, index) {
	            //         var width;
	            //         if (field.templateOptions == undefined)
	            //             width = averageWidth;
	            //         else
	            //             width = field.templateOptions.width || averageWidth;
	            //         $scope.colClass[index] = 'col-md-' + width + ' col-sm-' + width + ' col-xs-' + width;
	            //     });
	            // }

	            // this is what formly-form does, but because we're not using formly-form, we have to do this ourselves.
	            //$scope.$watch('model', function() {
	            //  angular.forEach($scope.to.fields, function(field) {
	            //    field.runExpressions && field.runExpressions();
	            //  });
	            //}, true);


	        }
	    });
	    formlyConfigProvider.setType({
	        name: 'radioFlat',
	       
	        template: "<div class=\"radio-group\"> <label class=\"radio-inline\" ng-repeat=\"option in to.options track by $index\"> <input type=\"radio\" id=\"{{id + '_'+ $index}}\" value=\"{{option[to.valueProp || 'value']}}\" ng-model=\"model[options.key]\">{{option[to.keyProp || 'name']}}</label></div>",
	        controller: function ($scope) {
	            if (!$scope.model[$scope.options.key])
	            $scope.model[$scope.options.key] = "";
	        }
	    });

	  
	    formlyConfigProvider.setType({
	        name: 'repeatSection',
	       
	        template: '<div> <div class="repeatsection" ng-repeat="element in model[options.key] track by $index"> <formly-form fields="to.fields" model="element" form-state="formOptions"> </formly-form> <div style="margin-bottom:20px;"> <button type="button" class="btn btn-sm btn-danger" ng-click="model[options.key].splice($index, 1)"> Remove </button> </div><hr> </div><p class="AddNewButton"> <button type="button" class="btn btn-primary" ng-click="addNew()">{{to.btnText}}</button> </p></div>',
	        controller: function ($scope) {

	            $scope.formOptions = {
	                formState: $scope.formState
	            };

	            $scope.addNew = function () {
	                var repeatsection = $scope.model[$scope.options.key];

	                var lastSection = repeatsection[repeatsection.length - 1];
	                var newsection = {};
	                if (lastSection) {

	                    newsection = angular.copy(lastSection);

	                    //angular.forEach(newsection, function (value, key, obj) {
	                    //    obj[key] = "";
	                    //});
	                }

	                repeatsection.push(newsection);

	            };




	        }

	    });


	    formlyConfigProvider.setType({
	        name: 'date',
	        template: '<input type="text" date-format="{{to.dateFormat}}" class="form-control" ng-model="model[options.key]" jqdatepicker/>',
	       
	        wrapper: ['bootstrapLabel', 'bootstrapHasError']
	    });
	    formlyConfigProvider.setType({
	        name: 'linkText',
	        template: '<input type="text" class="form-control" ng-model="model[options.key]" modelname="{{options.key}}" copy-value="{{to.parentMode}}" displayname={{to.displayField}} >',
	        // ng-model="model.fundManager"-->
	        wrapper: ['bootstrapLabel', 'bootstrapHasError']
	    });
	    formlyConfigProvider.setType({
	        name: 'linkedSelect',
	        //template: '<div class="radio-group"><div class="radio" ng-repeat="option in options"><label><input type="radio" name="{{id}}"  value="{{option}}">{{option}}</label></div></div>',
	       
	        template: "<div class=\"radio-group\"><div ng-repeat=\"option in optionsArray\" class=\"radio\"> <label><input type=\"radio\" id=\"{{id + '_'+ $index}}\" ng-value=\"option\" ng-model=\"model[options.key]\">{{option}}</label></div></div>",
	        controller: function ($scope) {
	            $scope.$watch('to.options', function (newValue, oldValue) {
	                if (newValue) {
	                    $scope.optionsArray = angular.fromJson($scope.to.options);
	                    $scope.optionsArray = $scope.optionsArray[$scope.to.displayFieldName];

	                }
	            }

	        )
	        },
	        wrapper: ['bootstrapLabel', 'bootstrapHasError']
	    });
	    formlyConfigProvider.setType({
	        name: 'checkBoxList',
	        template: '<div class="Tool_item Tool_checkbox"><div class="mgT-6"><div class="checkbox" ng-repeat="option in to.options"><label><input type="checkbox" checkbox-group value="{{option}}" ng-click="tickCheckBox($event,model[options.key])" ng-checked="model[options.key].indexOf(option)>=0" /><span>{{option}}</span></label></div></div></div>',
	        
	        controller: function ($scope) {
	            $scope.$watch('to.options', function (newValue, oldValue) {
	                if (newValue) {
	                    $scope.optionsArray = $scope.to.options;
	                    //$scope.optionsArray=$scope.optionsArray[$scope.to.displayFieldName];

	                }
	            }

	        )
	        },
	        wrapper: ['bootstrapLabel', 'bootstrapHasError']
	    });
	    formlyConfigProvider.setType({
	        name: 'file',
	        template: '<upload-attachment/>',
	        
	        /*
	        controller:function($scope,formService)
	        {
	            
	           $scope.$watch('files', function () {
	              $scope.upload($scope.files);
	              });
	  
	          $scope.upload = function (files) {
	              if (files && files.length) {
	                  
	                  for (var i = 0; i < files.length; i++) {
	                      var file = files[i];
	                      // upload the files
	                      promise=formService.uploadAttachment(file);
	                      
	                  }
	              }
	          };
	        },*/
	        wrapper: ['bootstrapLabel', 'bootstrapHasError']
	    });
	    formlyConfigProvider.setType({
	        name: 'formButton',
	        template: '<add-button/>',
	        //template: '<button type="button" class="btn btn-primary" ng-click="to.btnAction" >{{to.btnText}}</button>',
	        /*  controller:function($scope,ICApprovalForm) {
	              
	              $scope.saveComment=function(){
	                  formService.saveFormData(JSON.stringify(model));
	          }
	          },*/
	        wrapper: ['bootstrapLabel', 'bootstrapHasError']
	    });
	    formlyConfigProvider.setType({
	        name: 'linkDropDown',
	       
	        template: "<div class=\"radio-group\"><div ng-repeat=\"option in to.options\" class=\"radio\"> <label><input type=\"radio\" id=\"{{id + '_'+ $index}}\" value=\"{{option}}\" ng-model=\"model[options.key]\" ng-click=\"tickRadioBtn(model,$event,options.key)\" >{{option[to.displayFieldName]}}</label> </div></div>",
	        controller: function ($scope) {
	            $scope.currentValue = $scope.model[$scope.options.key][$scope.to.displayFieldName];
	        },
	        wrapper: ['bootstrapLabel', 'bootstrapHasError']
	    });

	    formlyConfigProvider.setType({
	        name: "textareaReadonly",
	        template: '<textarea class="form-control" rows="5" ng-model="model[options.key]" readonly></textarea>',
	        wrapper: ["bootstrapLabel", "bootstrapHasError"],
	    });

	}]);

/***/ },
/* 7 */
/***/ function(module, exports) {

	
	angular.module('formlyObj').constant('constantData', {
	    appFormDesignListName: "SPDesignForms",
	    publishFields: [
	        {
	           template:"<p>You can publish the above form to an SharePoint list in the host web site, by type an new list name/or use the default \"MyForm\", then click the \"Publish Form\" buttom </p>"
	        },
	        {
	            type: "input",
	            key: "TargetListName",

	            templateOptions: {
	                label: 'Publish target list name:',
	                required: true
	            }
	        }
	    ],
	    publishModel: {
	        TargetListName: ''
	    },
	    // defaultFormDesign: {
	    //     "default": [
	    //       {
	    //           "component": "htmlContent",
	    //           "editable": true,
	    //           "index": 0,
	    //           "label": "",
	    //           "description": "",
	    //           "placeholder": "",
	    //           "options": [],
	    //           "required": false,
	    //           "validation": "/.*/",
	    //           "id": "default-htmlContent-1280",
	    //           "isContainer": false,
	    //           "templateOptions": {
	    //               "htmlContent": "<h3>Personal Account Dealing Form</h3><a href=\"#\">What is PA Dealing?</a>\n<hr/>"
	    //           },
	    //           "expressionProperties": "",
	    //           "noFormControl": false
	    //       },
	    //       {
	    //           "component": "multiField",
	    //           "editable": true,
	    //           "index": 1,
	    //           "label": "horizontal layout",
	    //           "description": "",
	    //           "placeholder": "",
	    //           "options": [],
	    //           "required": false,
	    //           "validation": "/.*/",
	    //           "id": "default-multiField-6745",
	    //           "isContainer": true,
	    //           "templateOptions": {},
	    //           "expressionProperties": "",
	    //           "noFormControl": true
	    //       },
	    //       {
	    //           "component": "multiField",
	    //           "editable": true,
	    //           "index": 2,
	    //           "label": "horizontal layout",
	    //           "description": "",
	    //           "placeholder": "",
	    //           "options": [
	    //             "<span color=\"red\"><- click No to hide the repeat section</span>"
	    //           ],
	    //           "required": false,
	    //           "validation": "/.*/",
	    //           "id": "default-multiField-6076",
	    //           "isContainer": true,
	    //           "templateOptions": {},
	    //           "expressionProperties": "",
	    //           "noFormControl": true
	    //       },
	    //       {
	    //           "component": "repeatSection",
	    //           "editable": true,
	    //           "index": 3,
	    //           "label": "repeat section",
	    //           "description": "",
	    //           "placeholder": "",
	    //           "options": [],
	    //           "required": false,
	    //           "validation": "/.*/",
	    //           "id": "default-repeatSection-1867",
	    //           "isContainer": true,
	    //           "templateOptions": {
	    //               "btnText": "Add Another Section"
	    //           },
	    //           "expressionProperties": "\"hide\":\"model.Question1!=='Yes'\"",
	    //           "noFormControl": true
	    //       },
	    //       {
	    //           "component": "multiField",
	    //           "editable": true,
	    //           "index": 4,
	    //           "label": "horizontal layout",
	    //           "description": "",
	    //           "placeholder": "",
	    //           "options": [],
	    //           "required": false,
	    //           "validation": "/.*/",
	    //           "id": "default-multiField-2764",
	    //           "isContainer": true,
	    //           "templateOptions": {},
	    //           "expressionProperties": "",
	    //           "noFormControl": true
	    //       }
	    //     ],
	    //     "default-multiField-6745": [
	    //       {
	    //           "key": "RefNo",
	    //           "component": "textInput",
	    //           "editable": true,
	    //           "index": 0,
	    //           "label": "Reference No:",
	    //           "description": "description",
	    //           "placeholder": "placeholder",
	    //           "options": [],
	    //           "required": true,
	    //           "validation": "[number]",
	    //           "id": "default-multiField-6745-textInput-4226",
	    //           "isContainer": false,
	    //           "templateOptions": {
	    //               "listFieldName": "Title"
	    //           },
	    //           "expressionProperties": "",
	    //           "noFormControl": true
	    //       },
	    //       {
	    //           "key": "date",
	    //           "component": "datePicker",
	    //           "editable": true,
	    //           "index": 1,
	    //           "label": "",
	    //           "description": "",
	    //           "placeholder": "",
	    //           "options": [],
	    //           "required": true,
	    //           "validation": "/.*/",
	    //           "id": "default-multiField-6745-datePicker-3206",
	    //           "isContainer": false,
	    //           "templateOptions": {
	    //               "label": "Date:",
	    //               "dateFormat": "yy-mm-dd",
	    //               "listFieldName": "InvestmentData"
	    //           },
	    //           "expressionProperties": "",
	    //           "noFormControl": true
	    //       }
	    //
	    //     ],
	    //     "default-multiField-6076": [
	    //       {
	    //           "component": "htmlContent",
	    //           "editable": true,
	    //           "index": 0,
	    //           "label": "",
	    //           "description": "",
	    //           "placeholder": "",
	    //           "options": [],
	    //           "required": false,
	    //           "validation": "/.*/",
	    //           "id": "default-multiField-6076-htmlContent-3214",
	    //           "isContainer": false,
	    //           "templateOptions": {
	    //               "htmlContent": "1. Any preapproval activities to declare? * <a href=\"#\">Click here for more information about preapproval activities</a>"
	    //           },
	    //           "expressionProperties": "",
	    //           "noFormControl": false
	    //       },
	    //       {
	    //           "key": "Question1",
	    //           "component": "radioFlat",
	    //           "editable": true,
	    //           "index": 1,
	    //           "label": "",
	    //           "description": "",
	    //           "placeholder": "",
	    //           "options": [
	    //             "Yes",
	    //             "No"
	    //           ],
	    //           "required": false,
	    //           "validation": "/.*/",
	    //           "id": "default-multiField-6076-radioFlat-4794",
	    //           "isContainer": false,
	    //           "templateOptions": {},
	    //           "expressionProperties": "",
	    //           "noFormControl": true
	    //       },
	    //       {
	    //           "component": "htmlContent",
	    //           "editable": true,
	    //           "index": 2,
	    //           "label": "",
	    //           "description": "",
	    //           "placeholder": "",
	    //           "options": [],
	    //           "required": false,
	    //           "validation": "/.*/",
	    //           "id": "default-multiField-6076-htmlContent-2766",
	    //           "isContainer": false,
	    //           "templateOptions": {
	    //               "htmlContent": "<span style=\"color:red\"><- choose No will hide the repeat section</span>"
	    //           },
	    //           "expressionProperties": "",
	    //           "noFormControl": false
	    //       }
	    //     ],
	    //     "default-repeatSection-1867": [
	    //       {
	    //           "component": "multiField",
	    //           "editable": true,
	    //           "index": 0,
	    //           "label": "horizontal layout",
	    //           "description": "",
	    //           "placeholder": "",
	    //           "options": [],
	    //           "required": false,
	    //           "validation": "/.*/",
	    //           "id": "default-repeatSection-1867-multiField-1632",
	    //           "isContainer": true,
	    //           "templateOptions": {},
	    //           "expressionProperties": "",
	    //           "noFormControl": true
	    //       },
	    //       {
	    //           "key": "investmentValue",
	    //           "component": "textInput",
	    //           "editable": true,
	    //           "index": 1,
	    //           "label": "Value:",
	    //           "description": "description",
	    //           "placeholder": "placeholder",
	    //           "options": [],
	    //           "required": true,
	    //           "validation": "/.*/",
	    //           "id": "default-repeatSection-1867-textInput-1665",
	    //           "isContainer": false,
	    //           "templateOptions": {},
	    //           "expressionProperties": "",
	    //           "noFormControl": true
	    //       },
	    //       {
	    //           "component": "htmlContent",
	    //           "editable": true,
	    //           "index": 2,
	    //           "label": "",
	    //           "description": "",
	    //           "placeholder": "",
	    //           "options": [],
	    //           "required": false,
	    //           "validation": "/.*/",
	    //           "id": "default-repeatSection-1867-htmlContent-8599",
	    //           "isContainer": false,
	    //           "templateOptions": {
	    //               "htmlContent": "If not you who is executing the trade?"
	    //           },
	    //           "expressionProperties": "",
	    //           "noFormControl": false
	    //       },
	    //       {
	    //           "key": "name",
	    //           "component": "textInput",
	    //           "editable": true,
	    //           "index": 3,
	    //           "label": "Name:",
	    //           "description": "description",
	    //           "placeholder": "placeholder",
	    //           "options": [],
	    //           "required": true,
	    //           "validation": "/.*/",
	    //           "id": "default-repeatSection-1867-textInput-7969",
	    //           "isContainer": false,
	    //           "templateOptions": {},
	    //           "expressionProperties": "",
	    //           "noFormControl": true
	    //       },
	    //       {
	    //           "key": "requesterComment",
	    //           "component": "textArea",
	    //           "editable": true,
	    //           "index": 4,
	    //           "label": "Requester Comment:",
	    //           "description": "description",
	    //           "placeholder": "placeholder",
	    //           "options": [],
	    //           "required": false,
	    //           "validation": "/.*/",
	    //           "id": "default-repeatSection-1867-textArea-1358",
	    //           "isContainer": false,
	    //           "templateOptions": {},
	    //           "expressionProperties": "",
	    //           "noFormControl": true
	    //       }
	    //     ],
	    //     "default-repeatSection-1867-multiField-1632": [
	    //       {
	    //           "key": "investmentType",
	    //           "component": "select",
	    //           "editable": true,
	    //           "index": 0,
	    //           "label": "Type of Investment:",
	    //           "description": "description",
	    //           "placeholder": "placeholder",
	    //           "options": [
	    //             "Preapproval Activity",
	    //             "Post-trade Notification"
	    //           ],
	    //           "required": true,
	    //           "validation": "/.*/",
	    //           "id": "default-repeatSection-1867-multiField-1632-select-8988",
	    //           "isContainer": false,
	    //           "templateOptions": {},
	    //           "expressionProperties": "",
	    //           "noFormControl": true
	    //       },
	    //       {
	    //           "key": "investmentName",
	    //           "component": "textInput",
	    //           "editable": true,
	    //           "index": 1,
	    //           "label": "Name of Investment",
	    //           "description": "description",
	    //           "placeholder": "placeholder",
	    //           "options": [],
	    //           "required": true,
	    //           "validation": "/.*/",
	    //           "id": "default-repeatSection-1867-multiField-1632-textInput-259",
	    //           "isContainer": false,
	    //           "templateOptions": {},
	    //           "expressionProperties": "",
	    //           "noFormControl": true
	    //       },
	    //       {
	    //           "key": "investmentDate",
	    //           "component": "datePicker",
	    //           "editable": true,
	    //           "index": 2,
	    //           "label": "",
	    //           "description": "",
	    //           "placeholder": "",
	    //           "options": [],
	    //           "required": true,
	    //           "validation": "/.*/",
	    //           "id": "default-repeatSection-1867-multiField-1632-datePicker-1161",
	    //           "isContainer": false,
	    //           "templateOptions": {
	    //               "label": "Date of Investment:",
	    //               "dateFormat": "yy-mm-dd"
	    //           },
	    //           "expressionProperties": "",
	    //           "noFormControl": true
	    //       }
	    //     ],
	    //     "default-multiField-2764": [
	    //       {
	    //           "component": "checkbox",
	    //           "editable": true,
	    //           "index": 0,
	    //           "label": "Declaration: I confirm this request is in compliance with the Investors Personal Account Policy",
	    //           "description": "description",
	    //           "placeholder": "placeholder",
	    //           "options": [
	    //             "Yes"
	    //           ],
	    //           "required": true,
	    //           "validation": "/.*/",
	    //           "id": "default-multiField-2764-checkbox-6333",
	    //           "isContainer": false,
	    //           "templateOptions": {},
	    //           "expressionProperties": "",
	    //           "noFormControl": true
	    //       }
	    //     ]
	    // }
	    defaultFormDesign:{

	    }

	});



/***/ },
/* 8 */
/***/ function(module, exports) {

	angular.module('formlyObj').constant('deepMerge', (function () {
	    var objectPrototype = Object.getPrototypeOf({});
	    var arrayPrototype = Object.getPrototypeOf([]);

	    return deepMerge;

	    function deepMerge() {
	        var res = arguments[0];
	        angular.forEach(arguments, function (src, index) {
	            //console.log(src);
	           // console.log(index);
	            if (src && (index > 0 || false)) {
	                angular.forEach(src, function (val, prop) {
	                    if (typeof val === "object" && val !== null && isObjectOrArrayLike(val)) {
	                        var deepRes = res[prop];
	                        if (!deepRes && Array.isArray(val)) {
	                            deepRes = [];
	                        } else if (!deepRes) {
	                            deepRes = {};
	                        }
	                        res[prop] = deepMerge(deepRes, val);
	                    } else {
	                        res[prop] = val;
	                    }
	                });
	            }
	        });
	        return res;
	    }

	    function isObjectOrArrayLike(val) {
	        var proto = Object.getPrototypeOf(val);
	        return proto === objectPrototype || proto === arrayPrototype;
	    }
	})());
	/*
	   * This is where the magic of OIM comes into play, we generate the field
	   * config based on the values in the model. You would write this function
	   * to generate the config based on the config format of your server's model
	   * meta data.
	   */
	angular.module('formlyObj').factory('getOIMConfig',["deepMerge", function (deepMerge) {
	    function getOIMConfig(optionsOrignal, builderForms) {
	        optionsCopy=angular.copy(optionsOrignal);
	        options = optionsCopy || {}; 
	        var fields = [];
	        angular.forEach(options, function (field, index, options) {
	            console.log(field);
	           // var field = angular.copy(fieldOriginal);
	            if (!field.noFormControl)
	            {
	                console.log('a');
	                var content = {                
	                    template: field.templateOptions.htmlContent == undefined ? " " : field.templateOptions.htmlContent
	                };
	                console.log('content');
	                fields.push(content);
	            }
	            else{
	                console.log('b');
	                var key;
	                if (field.key)
	                    key = field.key;
	                else if (field.id)
	                    key = field.id;
	                var value = "";
	                fields.push(getOptionsFromValue(value, key, field, builderForms));
	            }
	        });
	        return fields;
	     };
	     return {
	         getOIMConfig: getOIMConfig
	     }

	     function getNestedFields(builderForms, propMetaData) {
	         var _fields;
	         if (builderForms[propMetaData.id])
	             _fields = getOIMConfig(builderForms[propMetaData.id], builderForms);
	         else
	              _fields = [];
	          return _fields;
	     }
	     function getOptionsFromValue(value, key, propMetaData, builderForms) {
	        //get label
	        var label, placeholder;
	        if (propMetaData.label)
	            label = propMetaData.label;
	        else
	            label= makeHumanReadable(key);

	        //get placeholder
	       
	        if (propMetaData.placeholder!="")
	            placeholder = propMetaData.placeholder;

	        var commonOptions = {
	            key: key,
	            templateOptions: {}
	            
	        };
	        //这里是从builder转问卷属性
	        if (propMetaData.hasOwnProperty('expressionProperties') && propMetaData.expressionProperties) {
	            commonOptions.expressionProperties = angular.fromJson("{"+propMetaData.expressionProperties+"}");
	        }
	        if (propMetaData.hasOwnProperty('templateOptions')) {
	            commonOptions.templateOptions = propMetaData.templateOptions;
	        }
	        if (propMetaData.hasOwnProperty('required')) {
	            commonOptions.templateOptions.required = propMetaData.required;
	        }
	         if (propMetaData.hasOwnProperty('userinfo')) {
	             commonOptions.templateOptions.userinfo = propMetaData.userinfo;
	         }
	         if (propMetaData.hasOwnProperty('index')) {
	             commonOptions.templateOptions.index = propMetaData.index;
	         }
	         if (propMetaData.hasOwnProperty('description')) {
	             commonOptions.templateOptions.description = propMetaData.description;
	         }
	        
	        if (!commonOptions.templateOptions.label)
	            commonOptions.templateOptions.label = label;

	        commonOptions.templateOptions.placeholder= placeholder;
	        
	       

	        var typeOf = propMetaData.component || typeof value;
	        var typeOptions = {};
	         console.log(typeOf);
	        switch (typeOf) {

	            //case 'htmlContent': {

	            //    typeOptions = {
	            //        template: propMetaData.templateOptions.htmlContent
	            //    };
	            //    return typeOptions;
	            //    break;
	            //}
	            case 'currentUser': {

	                typeOptions = {
	                    type: 'currentUser'
	                    

	                };

	                break;
	            }
	            case 'repeatSection': {
	               
	                typeOptions = {
	                    type: 'repeatSection',
	                    templateOptions: {
	                        fields: getNestedFields(builderForms, propMetaData),
	                        btnText:propMetaData.templateOptions.btnText//'Add another investment'
	                    }
	                   
	                    
	                };

	                break;
	            }
	            case 'multiField': {
	                
	                typeOptions = {
	                    type: 'multiField',
	                    templateOptions: {
	                        fields: getNestedFields(builderForms, propMetaData)
	                    }
	                };

	                break;
	            }
	            case 'radioFlat': {
	                typeOptions = {
	                    type: 'radioFlat',
	                    'defaultValue':'Yes',
	                    templateOptions: {
	                        options: propMetaData.options.map(function (option) {
	                            return {
	                                name: makeHumanReadable(option),
	                                value: option
	                            };
	                        }),
	                        keyProp: name,
	                        valueProp:value
	                    }
	                };

	                break;
	            }
	            case 'button': {
	                typeOptions = {
	                    type: 'formButton'

	                };
	                break;
	            }
	            case 'select':
	                {
	                    typeOptions = {
	                        type: 'select',
	                        templateOptions: {
	                            options: propMetaData.options.map(function (option) {
	                                return {
	                                    name: makeHumanReadable(option),
	                                    value: option
	                                };
	                            })
	                        }
	                    };
	                    break;
	                }
	            case 'radio':
	                {
	                    typeOptions = {
	                        type: 'radio',
	                        templateOptions: {
	                            valueProp: 'value',
	                            keyProp: 'name',
	                            options: propMetaData.options.map(function (option) {
	                                return {
	                                    name: makeHumanReadable(option),
	                                    value: option
	                                };
	                            })
	                        }
	                    };
	                    break;
	                }

	            case 'enum': {
	                var totalOptions = propMetaData.options.length;
	                var type = 'radio';
	                if (totalOptions > 5) {
	                    type = 'select';
	                }
	                typeOptions = {
	                    type: type,
	                    templateOptions: {
	                        options: propMetaData.options.map(function (option) {
	                            return {
	                                name: makeHumanReadable(option),
	                                value: option
	                            };
	                        })
	                    }
	                };
	                break;
	            }
	            case 'linkedOptions': {
	                typeOptions = {
	                    type: 'linkedSelect'
	                };
	                break;

	            }
	            case 'linkDropDownOptions': {
	                typeOptions = {
	                    type: 'linkDropDown'
	                };
	                break;

	            }
	            case 'textareaReadonly': {



	                typeOptions = {
	                    type: 'textareaReadonly'
	                };
	                break;

	            }

	            case 'checkbox': {



	                typeOptions = {
	                    type: 'checkBoxList',
	                    templateOptions:{
	                        options: propMetaData.options
	                    }
	                };
	                break;

	            }

	            case 'linkDropDown': {
	                var parentFieldName = propMetaData.parentFieldName;
	                if (parentFieldName) {
	                    var displayFieldName = propMetaData.displayFieldName;
	                    var parentFieldModel = propMetaData.parentFieldModel;
	                    var totalOptions = propMetaData.options.length;
	                    var type = 'radio';
	                    if (totalOptions > 5) {
	                        type = 'select';
	                    }
	                    childoptions = [];
	                    angular.forEach(propMetaData.options, function (option) {
	                        if (option[parentFieldName] == parentFieldModel) {
	                            angular.forEach(option[displayFieldName], function (optionvalue) {
	                                var obj = { name: makeHumanReadable(optionvalue), value: optionvalue };
	                                childoptions.push(obj);
	                            }

	                            )

	                        }


	                    });


	                    typeOptions = {
	                        type: type,
	                        templateOptions: {
	                            options: childoptions
	                        }
	                    };
	                }
	                else {
	                    var displayFieldName = propMetaData.displayFieldName;
	                    var totalOptions = propMetaData.options.length;
	                    var type = 'radio';
	                    if (totalOptions > 5) {
	                        type = 'select';
	                    }
	                    typeOptions = {
	                        type: type,
	                        templateOptions: {
	                            options: propMetaData.options.map(function (option) {
	                                return {
	                                    name: makeHumanReadable(option[displayFieldName]),
	                                    value: option
	                                };
	                            })
	                        }
	                    };
	                }
	                break;
	            }

	            case 'boolean': {
	                typeOptions = {
	                    type: 'checkbox'
	                };
	                break;
	            }
	            case 'number': {
	                typeOptions = {
	                    type: 'input',
	                    templateOptions: { type: 'number' }
	                };
	                break;
	            }
	            case 'datePicker': {
	                typeOptions = {
	                    type: 'date'
	                };
	                break;
	            }
	            case 'linkText': {
	                var parentMode = propMetaData.parentMode;
	                var displayField = propMetaData.displayField;

	                typeOptions = {
	                    type: 'linkText',
	                    /*expressionProperties: {
	                    'templateOptions.value':'model.'+parentMode
	                    },*/
	                    templateOptions: {
	                        disabled: true
	                    }

	                };


	                break;
	            }
	            case 'textArea':
	                {
	                    typeOptions = {
	                        type: 'textarea'
	                    };
	                    break;
	                }
	            case 'file':
	                {
	                    typeOptions = {
	                        type: 'file',
	                        templateOptions: {

	                        }
	                    };
	                    break;


	                }
	            case 'string':
	            default:
	                var type = (value && value.length) > 80 ? 'textarea' : 'input';
	                typeOptions = { type: type };
	        }
	        return deepMerge(commonOptions, typeOptions, propMetaData.formlyOptions);
	    }

	    function makeHumanReadable(key) {
	        if (key) {
	           // var words = key.match(/[A-Za-z][a-z]*/g);
	           // words.map(capitalize).join(" ");
	           return key;
	        }
	        else
	            return "";
	    }

	    function capitalize(word) {
	        return word.charAt(0).toUpperCase() + word.substring(1);
	    }
	}]);

/***/ },
/* 9 */
/***/ function(module, exports) {

	angular.module('formlyObj').directive('jqdatepicker', function () {
	    return {
	        restrict: 'A',
	        require: 'ngModel',
	        link: function (scope, element, attrs, ngModelCtrl) {
	            element.datepicker({
	                dateFormat: attrs.dateFormat
	            });
	        }
	    };
	});

	angular.module('formlyObj').directive("checkboxGroup", function () {
	    return {
	        restrict: "A",
	        //scope : {
	        //    model: "=",
	        //    options:"="
	        //    },
	        controller: function ($scope) {
	            if (!$scope.model[$scope.options.key])
	                $scope.model[$scope.options.key] = [];
	            var currentSelection = $scope.model[$scope.options.key];
	            $scope.tickCheckBox = function ($event) {
	                var elem = $event.currentTarget;
	                if (!currentSelection)
	                    currentSelection = [];
	                var index = currentSelection.indexOf(elem.value);
	                // Add if checked
	                if (elem.checked) {
	                    if (index === -1) currentSelection.push(elem.value);
	                }
	                    // Remove if unchecked
	                else {
	                    if (index !== -1) currentSelection.splice(index, 1);
	                }
	            }
	        }
	    };
	});
	angular.module('formlyObj').directive("copyValue", function () {
	    return {
	        restrict: "A",
	        link: function (scope, elem, attrs) {

	            // Determine initial checked boxes
	            scope.$watch(attrs.copyValue, function (newValue, oldValue) {
	                if (newValue) {
	                    if (newValue[attrs.displayname])
	                        scope.model[attrs.modelname] = newValue[attrs.displayname][0];
	                    else if (newValue.indexOf("{") == 0) {
	                        value = angular.fromJson(newValue);
	                        scope.model[attrs.modelname] = value[attrs.displayname][0];
	                    }


	                }

	            });



	        }
	    }
	});
	angular.module('formlyObj').directive("fileUpload", function ($upload) {
	    return {
	        restrict: "A",
	        link: function (scope, elem, attrs) {

	            // Determine initial checked boxes
	            scope.$watch(attrs.copyValue, function (newValue, oldValue) {
	                if (newValue && newValue[attrs.displayname])
	                    scope.model[attrs.modelname] = newValue[attrs.displayname][0];
	            });



	        }
	    }
	});

	angular.module('formlyObj').directive("radioChecked", function () {
	    return {
	        restrict: "A",
	        link: function (scope, elem, attrs) {
	            if (attrs.radioChecked)
	                elem[0].click();
	            scope.tickRadioBtn = function (model, $event, key) {
	                var elem = $event.currentTarget;

	                model[key] = elem.value;
	            };

	        }
	    }
	});

	angular.module('formlyObj').directive("addButton", function (formService) {
	    return {
	        restrict: 'AE',
	        replace: true,
	        template: '<button type="button" class="btn btn-primary" ng-click="addNewInvestment()" >{{to.btnText}}</button>',

	        link: function (scope, iElement, iAttrs) {

	            scope.addNewInvestment = function () {
	                var repeatsection = scope.model["investments"];
	                //remove the bits which is added in by angular
	                lastSection = repeatsection[repeatsection.length - 1];
	                lastSectionJSON = angular.toJson(lastSection);
	                newsectionJSON = lastSectionJSON.substring(0, lastSectionJSON.lastIndexOf(',')) + "}";
	                newsection = angular.fromJson(newsectionJSON);

	                repeatsection.push(newsection);

	            }
	        }

	    }

	});
	angular.module('formlyObj').directive("uploadAttachment", function (formService) {
	    return {
	        restrict: 'AE',
	        //replace:true,
	        //template:'<div ng-file-drop ng-file-select ng-model="files" class="drop-box"drag-over-class="dragover" ng-multiple="true" allow-dir="true"accept="image/*,application/pdf">Drop files here or click to upload</div><div ng-no-file-drop>File Drag/Drop is not supported for this browser</div><ul><li ng-repeat="f in files" style="font:smaller">{{f.name}}</li></ul>'
	        templateUrl: Settings.siteURL + 'SiteAsset/JavaScript/templates/fileUpload.html',
	        controller: function ($scope) {

	            $scope.$watch('files', function () {
	                $scope.upload($scope.files);
	            });

	            $scope.upload = function (files) {
	                if (files && files.length) {
	                    var i = 0;
	                    var file = files[i];
	                    uploadoneFile(file, files, i)

	                }
	            };
	            function getfileLink(url, fileName) {

	                return "<a target='_blank' href='" + url + "'>" + fileName + "</a>&nbsp;&nbsp;&nbsp;&nbsp;<input type='button' ng-click='deleteFile(&quot;" + url + "&quot;,&quot;" + fileName + "&quot;)' value='delete'/>";
	            }
	            function uploadoneFile(file, files, i) {
	                // upload the files
	                promise = formService.uploadAttachment(file, JSON.stringify($scope.model));
	                promise.then(function (fileLink) {
	                    var filelinkHtml = getfileLink(Settings.siteFullURL + fileLink.link, fileLink.fileName);
	                    $scope.model.supportingDocuments.push(filelinkHtml);
	                    i++;
	                    if (i < files.length) {
	                        file = files[i];
	                        uploadoneFile(file, files, i);
	                    }
	                });

	            }
	            $scope.deleteFile = function (url, fileName) {
	                promise = formService.deleteAttachment(url);
	                promise.then(function () {
	                    //remove from from
	                    var itemIndex = $scope.model.supportingDocuments.indexOf(getfileLink(url, fileName));
	                    $scope.model.supportingDocuments.splice(itemIndex, 1);
	                }, function (error) { });
	            }
	        }

	    }

	});
	angular.module('formlyObj').directive('dynamic', function ($compile) {
	    return {
	        restrict: 'A',
	        replace: true,
	        link: function (scope, ele, attrs) {
	            scope.$watch(attrs.dynamic, function (html) {
	                ele.html(html);
	                $compile(ele.contents())(scope);
	            });
	        }
	    };
	});

	angular.module('formlyObj').directive('kcdRecompile', function ($compile, $parse) {
	    'use strict';
	    return {
	        scope: true, // required to be able to clear watchers safely
	        compile: function (el) {
	            var template = getElementAsHtml(el);
	            return function link(scope, $el, attrs) {
	                var stopWatching = scope.$parent.$watch(attrs.kcdRecompile, function (_new, _old) {
	                    var useBoolean = attrs.hasOwnProperty('useBoolean');
	                    if ((useBoolean && (!_new || _new === 'false')) || (!useBoolean && (!_new || _new === _old))) {
	                        return;
	                    }
	                    // reset kcdRecompile to false if we're using a boolean
	                    if (useBoolean) {
	                        $parse(attrs.kcdRecompile).assign(scope.$parent, false);
	                    }

	                    // recompile
	                    var newEl = $compile(template)(scope.$parent);
	                    $el.replaceWith(newEl);

	                    // Destroy old scope, reassign new scope.
	                    stopWatching();
	                    scope.$destroy();
	                });
	            };
	        }
	    };

	    function getElementAsHtml(el) {
	        return angular.element('<a></a>').append(el.clone()).html();
	    }
	});

	angular.module('formlyObj').directive('clickAndDisable', function () {
	    return {
	        link: function (scope, iElement, iAttrs) {
	            iElement.bind('click', function () {
	                iElement.prop('disabled', true);
	            });
	        }
	    };
	});
	angular.module('formlyObj').directive('manualInstruction', function () {
	    return {
	        link: function (scope, iElement, iAttrs) {
	            scope.$watch("showInstruction", function () {
	                if (scope.showInstruction) {
	                    var el = angular.element('<span/>');
	                    el.append('<strong>Please follow <a target="_blank" href="https://spengineeringltd-public.sharepoint.com/SitePages/ChangeListDefaultForms.aspx">this instruction<a/> before you click</strong> ');
	                    iElement.prepend(el);
	                }
	            });
	            
	           
	        }
	    };
	});

	try {
	    (function (i, s, o, g, r, a, m) {
	        i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
	            (i[r].q = i[r].q || []).push(arguments)
	        }, i[r].l = 1 * new Date(); a = s.createElement(o),
	        m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
	    })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');

	    ga('create', 'UA-63734510-1', 'auto');
	    ga('send', 'pageview');
	}
	catch (e)
	{ console.log(e);};



/***/ },
/* 10 */
/***/ function(module, exports, __webpack_require__) {

	(function () {
	    var business_COUNT = __webpack_require__(11).business_COUNT;
	    var count_model = __webpack_require__(14).countModel;
	    var ajaxConfig = __webpack_require__(13).ajaxConfigExternal;
	    count_model = Object.create(count_model);
	    angular.module('formlyObj.controllers').controller('MoaCountCtrl', ['$scope','$rootScope', '$timeout', '$location', '$sce', 'GlobalStorageService','toaster'
	        , function MoaCountCtrl($scope,$rootScope, $timeout, $location, $sce, GlobalStorageService,toaster) {
	            var vm = this;

	            //tab
	            $scope.showView = [true, false];
	            if(1){
	                $scope.baseurl='https://moa.sn.chinamobile.com:55555';
	                $scope.ifInner='';
	                $scope.ifNginx=$scope.baseurl+'/manage/manage';
	                $scope.timecount=2000;
	            }else{
	                $scope.baseurl='http://10.131.227.70';
	                $scope.ifInner='Inner';
	                $scope.ifNginx=$scope.baseurl+'/manage/manageInner';
	                $scope.timecount=2000;
	            }
	            function backspace(){
	                evt=window.event;
	                if (evt.keyCode == 8 && evt.srcElement.tagName != "INPUT" && evt.srcElement.type != "text")
	                    evt.returnValue=false;

	            }
	            window.onload=function () {
	                backspace();
	            };


	            $scope.nowUserId='';
	            $scope.mealType=true;
	            $scope.logType=true;

	            $scope.showWechat=true;
	         /*   var iframe = document.getElementById('iframeBody');
	            if (iframe.attachEvent){
	                iframe.attachEvent("onload", function(){
	                    alert("Local iframe is now loaded.");
	                });
	            } else {
	                iframe.onload = function(){
	                    alert("Local iframe is now loaded.");
	                };
	            }*/
	            function say(){
	               // alert("parent.html");
	            }
	            $scope.checkSum = function () {
	                if(!$scope.mealType&&!$scope.showWechat&&!$scope.logType){
	                    alert('您的账号没有访问后台管理的权限,请使用有权限的账户登录');
	                    window.open( $scope.baseurl, '_self');
	                }
	            }
	            $scope.ShowLoading=true;
	            $.ajax({
	                url: $scope.baseurl+'/api/v1/users/current',
	                /*  beforeSend: function (xhr) {
	                 //Authorization: Bearer csXj0J4o_qjubxR3NFBhkMhFN_Tixrx4fu0avH2myD4d3xi1
	                 xhr.setRequestHeader("Authorization", "Bearer tFucnJCDQoBLsrPASwqu71TiZcGcnf1lSdhZ_yXJvxqM4PjX");
	                 xhr.setRequestHeader("X_AS_USER",  GlobalStorageService.getEAccountId());
	                 },*/
	                type: "GET",

	                success: function(req){
	                    $scope.$apply(function() {

	                        console.log(req);
	                        $scope.nowUserId=req.login_name;
	                        $.ajax({
	                            url: $scope.baseurl+'/app8080/WebTest/sx_native/logUser.json',
	                            type: "GET",

	                            success: function(req1){
	                                console.log(req1);
	                                var mark=false;
	                                for(i in req1){
	                                    console.log(req1[i]);
	                                    if(req1[i].toLowerCase()== $scope.nowUserId.toLowerCase()){
	                                        console.log('log succ');
	                                        mark=true;
	                                        $scope.logType=true;

	                                        break;
	                                    }
	                                }
	                                if(!mark){
	                                    $scope.logType=false;
	                                    //   alert('您没有访问该模块的权限');
	                                    $scope.ShowLoading=false;
	                                    $scope.checkSum();
	                                }
	                            },error:function (ret) {
	                                $scope.logType=false;
	                                alert('网络请求失败');
	                                $scope.ShowLoading=false;
	                                console.log(ret);
	                            }
	                        });
	                        $.ajax({
	                            url: $scope.baseurl+'/app8080/MeetingManage/findIsLogo.do?logoType=web&logoName='+$scope.nowUserId,
	                            type: "GET",

	                            success: function(req2){
	                                console.log(req2);
	                              if(req2.response=='1'){
	                                  $scope.mealType=true;
	                              }else{
	                                  $scope.mealType=false;
	                              }
	                                $scope.checkSum();
	                            },error:function (ret) {
	                                $scope.mealType=false;
	                                alert('网络请求失败');
	                                $scope.ShowLoading=false;
	                                console.log(ret);
	                            }
	                        });
	                        $.ajax({
	                            url:  $scope.baseurl+'/api/v1/ocus/manage',//ajaxConfig.BASE_URL+'/adminAuth',
	                            type: "GET",
	                            // processData: false,  // 告诉jQuery不要去处理发送的数据
	                            //  contentType: 'application/x-www-form-urlencoded',   // 告诉jQuery不要去设置Content-Type请求头
	                            success: function(req0,status,xhr){
	                                $scope.ShowLoading=false;
	                                console.log(req0);
	                                $scope.ManageList=req0;
	                                var loginMark=false;

	                                $scope.ShowLoading=false;
	                                if(req0.length>0){
	                                    $scope.showWechat=true;

	                                }
	                                else{
	                                    $scope.showWechat=false;
	                                    $scope.checkSum();
	                                    /*   toaster.pop('info', "", "你没有访问该模块的权限");
	                                       alert('您没有管理员权限，请检查登录状态');
	                                       window.location.href=ajaxConfig.BE_URL+'/accounts/sign_in';*/
	                                }
	                                $scope.$apply();
	                            },error:function (ret) {
	                                $scope.ShowLoading=false;
	                                $scope.showWechat=false;
	                                toaster.pop('info', "", "网络请求失败,请重新登陆");
	                                $scope.$apply();
	                            }
	                        });
	                    });
	                },error:function (ret) {
	                    $scope.$apply(function() {
	                        $scope.ShowLoading=false;
	                       // alert('请您先登录！');
	                        // window.location.href= $scope.baseurl+'/manage/manage';
	                         window.location.href=$scope.ifNginx;
	                        console.log(ret);
	                    });

	                }
	            });



	            // $scope.i=0;
	            // $scope.tabClick=function(i){
	            //     $scope.i=i;
	            //     ;
	            // }

	            $scope.isshowService = true;
	            $scope.isshowDefault = true;

	            $scope.i = 7;
	            $scope.index = 7;
	            $scope.tabClick = function (index) {
	                $scope.i = index;
	                $scope.index = 7;

	                $scope.ShowLoading=true;
	                $timeout(function () {
	                    $scope.ShowLoading=false;
	                },$scope.timecount);
	                console.log("index=" + index);
	                if(index==0){
	                    $(".iframeBody").css("margin-left","224px");
	                    $scope.i=7;
	                    $scope.index = 0;
	                    $scope.isshowIframe = true;
	                    $scope.isshowIframeCross = false;
	                    $scope.isshowDefault = false;
	                    if($scope.someUrl == $scope.baseurl+'/app8080/WebTest/surveyManage'+$scope.ifInner+'/index.html'){
	                        console.log('111');
	                        $timeout(function(){
	                            $scope.someUrl = $sce.trustAsResourceUrl("");
	                            $timeout(function(){
	                                $scope.someUrl = $sce.trustAsResourceUrl($scope.baseurl+'/app8080/WebTest/surveyManage'+$scope.ifInner+'/index.html');
	                            },0);
	                        },0);
	                       // document.getElementById('iframeBody').contentWindow.location.reload(true);
	                    }else{
	                        $scope.someUrl = $sce.trustAsResourceUrl($scope.baseurl+'/app8080/WebTest/surveyManage'+$scope.ifInner+'/index.html');
	                    }

	                }else if(index==1){
	                    $scope.i=7;
	                    $scope.index = 1;
	                    $scope.isshowIframe = true;
	                    $scope.isshowIframeCross = false;
	                    $scope.isshowDefault = false;
	                    if($scope.someUrl == $scope.baseurl+'/app8080/WebTest/activityManage'+$scope.ifInner+'/index.html'){
	                        console.log('111');
	                        $timeout(function(){
	                            $scope.someUrl = $sce.trustAsResourceUrl("");
	                            $timeout(function(){
	                                $scope.someUrl = $sce.trustAsResourceUrl($scope.baseurl+'/app8080/WebTest/activityManage'+$scope.ifInner+'/index.html');
	                            },0);
	                        },0);
	                        // document.getElementById('iframeBody').contentWindow.location.reload(true);
	                    }else{
	                        $scope.someUrl = $sce.trustAsResourceUrl($scope.baseurl+'/app8080/WebTest/activityManage'+$scope.ifInner+'/index.html');
	                    }

	                }else if(index==2){
	                    $scope.i=7;
	                    $scope.index = 2;
	                    $scope.isshowIframe = true;
	                    $scope.isshowIframeCross = false;
	                    $scope.isshowDefault = false;
	                    if($scope.someUrl == $scope.baseurl+'/app8080/WebTest/feedManage'+$scope.ifInner+'/index.html'){
	                        console.log('111');
	                        $timeout(function(){
	                            $scope.someUrl = $sce.trustAsResourceUrl("");
	                            $timeout(function(){
	                                $scope.someUrl = $sce.trustAsResourceUrl($scope.baseurl+'/app8080/WebTest/feedManage'+$scope.ifInner+'/index.html');
	                            },0);
	                        },0);
	                        // document.getElementById('iframeBody').contentWindow.location.reload(true);
	                    }else{
	                        $scope.someUrl = $sce.trustAsResourceUrl($scope.baseurl+'/app8080/WebTest/feedManage'+$scope.ifInner+'/index.html');
	                    }

	                }else if(index==3){
	                    $scope.isshowService = false;
	                    $scope.isshowIframe = false;
	                    $scope.isshowIframeCross = true;
	                    $scope.isshowDefault = false;
	                    if($scope.someUrl == $scope.baseurl+'/app8080/mealManage'+$scope.ifInner+'/index.html'){
	                        console.log('111');
	                        $timeout(function(){
	                            $scope.someUrl = $sce.trustAsResourceUrl("");
	                            $timeout(function(){
	                                $scope.someUrl = $sce.trustAsResourceUrl($scope.baseurl+'/app8080/mealManage'+$scope.ifInner+'/index.html');
	                            },0);
	                        },0);
	                        // document.getElementById('iframeBody').contentWindow.location.reload(true);
	                    }else{
	                        $scope.someUrl = $sce.trustAsResourceUrl($scope.baseurl+'/app8080/mealManage'+$scope.ifInner+'/index.html');
	                    }

	                }else if(index==4){
	                    $scope.isshowService = false;
	                    $scope.isshowIframe = false;
	                    $scope.isshowIframeCross = true;
	                    $scope.isshowDefault = false;
	                    $.ajax({
	                        url: $scope.baseurl+'/app8080/WebTest/sx_native/logUser.json',
	                        type: "GET",

	                        success: function(req1){
	                            console.log(req1);
	                            var mark=false;
	                            for(i in req1){
	                                console.log(req1[i]);
	                                if(req1[i]== $scope.nowUserId){
	                                    console.log('log succ');
	                                    mark=true;
	                                    if($scope.someUrl == $scope.baseurl+'/app8080/WebTest/logManage'+$scope.ifInner+'/index.html'){
	                                        console.log('111');
	                                        $timeout(function(){
	                                            $scope.someUrl = $sce.trustAsResourceUrl("");
	                                            $timeout(function(){
	                                                $scope.someUrl = $sce.trustAsResourceUrl($scope.baseurl+'/app8080/WebTest/logManage'+$scope.ifInner+'/index.html');
	                                                console.log($scope.someUrl);
	                                            },0);
	                                        },0);
	                                        // document.getElementById('iframeBody').contentWindow.location.reload(true);
	                                    }else{
	                                        $scope.someUrl = $sce.trustAsResourceUrl($scope.baseurl+'/app8080/WebTest/logManage'+$scope.ifInner+'/index.html');
	                                    }

	                                    break;
	                                }
	                            }
	                            if(!mark){
	                                alert('您没有访问该模块的权限');
	                                $scope.ShowLoading=false;
	                            }
	                        },error:function (ret) {
	                            alert('网络请求失败');
	                            $scope.ShowLoading=false;
	                            console.log(ret);
	                        }
	                    });

	                }else if(index==5){
	                    if($scope.someUrl == $scope.baseurl){
	                        console.log('111');
	                        $timeout(function(){
	                            $scope.someUrl = $sce.trustAsResourceUrl("");
	                            $timeout(function(){
	                                $scope.someUrl = $sce.trustAsResourceUrl($scope.baseurl);
	                            },0);
	                        },0);
	                        // document.getElementById('iframeBody').contentWindow.location.reload(true);
	                    }else{
	                        $scope.someUrl = $sce.trustAsResourceUrl($scope.baseurl);
	                    }

	                }else if(index==6){
	                    $scope.i=7;
	                    $scope.isshowService = true;
	                    $scope.isshowIframe = false;
	                    $scope.isshowIframeCross = false;
	                    $scope.isshowDefault = true;
	                  /*  if($scope.someUrl == $scope.baseurl+'/sxydmoa/apps/sso_redirect?url=/mxpp/'){
	                        console.log('111');
	                        $timeout(function(){
	                            $scope.someUrl = $sce.trustAsResourceUrl("");
	                            $timeout(function(){
	                                $scope.someUrl = $sce.trustAsResourceUrl($scope.baseurl+'/sxydmoa/apps/sso_redirect?url=/mxpp/');
	                                console.log($scope.someUrl);
	                                window.open($scope.someUrl,'_blank');
	                            },0);
	                        },0);
	                        // document.getElementById('iframeBody').contentWindow.location.reload(true);
	                    }else{*/
	                        $scope.someUrl = $sce.trustAsResourceUrl($scope.baseurl+'/sxydmoa/apps/sso_redirect?url=/mxpp/');
	                        window.open($scope.someUrl,'_blank');
	                   // }
	                    $timeout(function () {
	                        $scope.ShowLoading=false;
	                    },1000);
	                }else if(index==7){
	                    $timeout(function () {
	                        $scope.ShowLoading=false;
	                    },100);
	                    $scope.i=7;
	                    //$location.path('/moa-count');
	                    $scope.isshowService = true;
	                    $scope.isshowIframe = false;
	                    $scope.isshowIframeCross = false;
	                    $scope.isshowDefault = true;
	                }else if(index==8){
	                    $scope.isshowService = false;
	                    $scope.isshowIframe = false;
	                    $scope.isshowIframeCross = false;
	                    $scope.isshowDefault = false;
	                }else if(index==9){
	                    $scope.isshowService = false;
	                    $scope.isshowIframe = false;
	                    $scope.isshowIframeCross = false;
	                    $scope.isshowDefault = false;
	                }

	                $scope.showView[index] = true;
	                for (var i = 0; i < $scope.showView.length; i++) {
	                    if (i == index) {
	                        $scope.showView[i] = true;
	                    }
	                    else {
	                        $scope.showView[i] = false;
	                    }
	                    //console.log("showview_" + i + "=" + $scope.showView[i]);
	                }
	            };
	            $scope.toMxpp = function (id){
	               /* if($scope.someUrl == $scope.baseurl+'/sxydmoa/apps/sso_redirect?url=/mxpp/'){
	                    console.log('111');
	                    $timeout(function(){
	                        $scope.someUrl = $sce.trustAsResourceUrl("");
	                        $timeout(function(){
	                            $scope.someUrl = $sce.trustAsResourceUrl($scope.baseurl+'/sxydmoa/apps/sso_redirect?url=/mxpp/?ocu_id='+id);
	                            console.log($scope.someUrl);
	                            window.open($scope.someUrl,'_blank');
	                        },0);
	                    },0);
	                    // document.getElementById('iframeBody').contentWindow.location.reload(true);
	                }else{*/
	                    $scope.someUrl = $sce.trustAsResourceUrl($scope.baseurl+'/sxydmoa/apps/sso_redirect?url=/mxpp/?ocu_id='+id);
	                    window.open($scope.someUrl,'_blank');
	               // }
	                $timeout(function () {
	                    $scope.ShowLoading=false;
	                },1000);
	            }
	           // $scope.someUrl = $sce.trustAsResourceUrl('/app8080/WebTest/activityManage/index.html');


	     }]);

	}());


/***/ },
/* 11 */
/***/ function(module, exports, __webpack_require__) {

	(function () {
	    /**
	     * Business 公文
	     */
	    var ajaxUtilObj = __webpack_require__(12).sharedAjaxUtilInstance;
	    var ajaxConfig = __webpack_require__(13).ajaxConfigExternal;
	    var business_COUNT = function () {

	        var self = this;

	        /**
	         *获取MOA用户数
	         */
	        self.getMoaUserNum = function (params) {//
	            var deferred = $.Deferred();
	            ajaxUtilObj.POST(/*window.mx_app_serverUrl+*/ajaxConfig.BASE_URL+ajaxConfig.getMoaUserNum, params).then(function (result_data) {
	                deferred.resolve(result_data);
	            }, function (ret) {
	                deferred.reject(ret);
	            });
	            return deferred.promise();

	        };
	        /**
	         *根据姓名查询设备信息
	         */
	        self.getDeviceInfoByName = function (params) {//
	            var deferred = $.Deferred();
	            ajaxUtilObj.GET(/*window.mx_app_serverUrl+*/ajaxConfig.BASE_URL+ajaxConfig.getDeviceInfoByName, params).then(function (result_data) {
	                deferred.resolve(result_data);
	            }, function (ret) {
	                deferred.reject(ret);
	            });
	            return deferred.promise();

	        };
	        /**
	         *根据日期查询登录明细
	         */
	        self.getLoginByDate = function (params) {//
	            var deferred = $.Deferred();
	            ajaxUtilObj.GET(/*window.mx_app_serverUrl+*/ajaxConfig.BASE_URL+ajaxConfig.getLoginByDate, params).then(function (result_data) {
	                deferred.resolve(result_data);
	            }, function (ret) {
	                deferred.reject(ret);
	            });
	            return deferred.promise();

	        };
	        /**
	         *根据日期查询登录明细
	         */
	        self.getNetworkError = function (params) {//
	            var deferred = $.Deferred();
	            ajaxUtilObj.GET(/*window.mx_app_serverUrl+*/ajaxConfig.BASE_URL+ajaxConfig.getNetworkError, params).then(function (result_data) {
	                deferred.resolve(result_data);
	            }, function (ret) {
	                deferred.reject(ret);
	            });
	            return deferred.promise();

	        };
	        /**
	         *根据截止时间获取moa用户数
	         */
	        self.getMoaUserNumByTime = function (params) {//
	            var deferred = $.Deferred();
	            ajaxUtilObj.GET(/*window.mx_app_serverUrl+*/ajaxConfig.BASE_URL+ajaxConfig.getMoaUserNumByTime, params).then(function (result_data) {
	                deferred.resolve(result_data);
	            }, function (ret) {
	                deferred.reject(ret);
	            });
	            return deferred.promise();

	        };


	    };
	    exports.business_COUNT = new business_COUNT();

	}());



/***/ },
/* 12 */
/***/ function(module, exports) {

	(function () {
	    /**
	     * AjaxUtil 类
	     *
	     * 用于封装 Zepto.js 中的 Ajax 请求
	     * 主要提供:
	     *   1.Ajax封装,提供加密选项
	     *   2.增加 Promise 封装
	     *   3.增加加密器及是否需要加密设置
	     *   4.加载过程中"等待"的遮罩控制
	     **/
	    var AjaxUtil = function () {

	        var self = this;
	        self.isEncrypt=true;
	        self.loadingCount=0;
	        //请求方式
	        var METHOD = {
	            GET: 'get',
	            POST: 'post'
	        };

	        var toastFun;
	        this.setToastFun = function(fun){
	            toastFun = fun;
	        };
	        this.getToastFun = function (){
	            return toastFun;
	        };

	        function showToast(toastTitle, toastTime) {
	            if (toastFun) {
	                toastFun.showToast(toastTitle, toastTime);
	            }
	        }

	        //是否需要显示加载遮罩 =========================================
	        var needShowWaiting = true;

	        /**
	         * 指定是否显示等待遮罩
	         **/
	        this.setNeedShowWaiting = function (show) {
	            needShowWaiting = show;
	        };

	        /**
	         * 获取是否显示等待遮罩
	         **/
	        this.getNeedShowWaiting = function () {
	            return needShowWaiting;
	        };

	        //用于存放控制遮罩的对象,需要实现show/hide方法 ==========================
	        var callbackLoading;
	        /**
	         * 指定负责控制遮罩的对象
	         **/
	        this.setCallbackFun = function (callbackFun) {
	            //console.log(callbackFun);
	            callbackLoading = callbackFun;
	        };

	        /**
	         * 获取负责控制遮罩的对象
	         **/
	        this.getCallbackFun = function () {
	            return callbackLoading;
	        };

	        /**
	         * 显示等待遮罩
	         **/
	        function showWaiting() {
	            if (callbackLoading) {
	                self.loadingCount++;
	                console.log(self.loadingCount);
	                if (needShowWaiting) {
	                    callbackLoading.show();
	                } else {
	                    needShowWaiting = true;
	                }
	            }
	        }

	        /**
	         * 隐藏等待遮罩
	         **/
	        function hideWaiting() {
	            if (callbackLoading) {
	                self.loadingCount--;
	                console.log(self.loadingCount);
	                if(self.loadingCount<=0){
	                    self.loadingCount=0;
	                    callbackLoading.hide();
	                }

	            }
	        }


	        //是否需要加密 ==========================================
	        var needEncrypt = false;

	        /**
	         * 设定是否需要加密
	         **/
	        this.setNeedEncrypt = function (bNeedEncrypt) {
	            needEncrypt = bNeedEncrypt;
	        };

	        /**
	         * 获取是否需要加密
	         **/
	        this.getNeedEncrypt = function () {
	            return needEncrypt;
	        };

	        //指定加密器 ==============================================
	        var encryptUtil = undefined;

	        /**
	         * 指定加密器
	         **/
	        this.setEncryptUtil = function (encryptObj) {
	            encryptUtil = encryptObj;
	        };

	        /**
	         * 获取加密器
	         **/
	        this.getEncryptUtil = function () {
	            return encryptUtil;
	        };


	        /**
	         * 用于发送 ajax 请求
	         *
	         * 参数:
	         *  url      需要请求的 URL
	         *  method   GET/POST
	         *  data     需要请求的 data,格式为 js 对象
	         *
	         * */
	        this.ajax = function (url, method, data) {

	           /* if (needEncrypt && encryptUtil) {
	                data = encryptUtil.encrypt(data);
	            }*/

	            //console.log('url=' + url, 'method=' + method);
	            var deferred = $.Deferred();

	            showWaiting();
	            console.log(data);
	            var reqOption = {
	                url: url,
	                data: data,
	                type: method,
	                timeout: 45000,
	                //contentType: 'application/x-www-form-urlencoded',
	                contentType: 'application/json',
	                //contentType: 'multipart/form-data',
	                //contentType: 'text/html',
	                //dataType: 'json',
	                async: true,
	                cache: false,
	                headers: {},
	                beforeSend: function (xhr, settings) {


	                },
	                success: function (reqdata, status, xhr) {
	                    ////console.log('reqdata =', reqdata);
	                    hideWaiting();

	                    console.log(reqdata);
	                    deferred.resolve(reqdata);

	                },
	                error: function (xhr, errorType, error) {
	                    var err = {
	                        xhr: xhr,
	                        errorType: errorType,
	                        error: error
	                    };
	                    //console.log(JSON.stringify(err));
	                    hideWaiting();
	                    if(error != null){
	                        deferred.reject(error);
	                    }else{
	                        deferred.reject(error);
	                        showToast(err.errorType+",请稍后重试", 1500);
	                    }
	                },
	                complete: function (xhr, status) {
	                    //hideWaiting();
	                }
	            };

	            console.dir(reqOption);
	            $.ajax(reqOption);

	            return deferred.promise();
	        };

	        /*
	         * GET 方法
	         * */
	        this.GET = function (url, data) {
	            return this.ajax(url, METHOD.GET, data);
	        };

	        /*
	         * POST 方法
	         * */
	        this.POST = function (url, data) {
	            return this.ajax(url, METHOD.POST, data);
	        };

	      this.ajaxNew = function (url, method, data) {

	        if (needEncrypt && encryptUtil) {
	          data = encryptUtil.encrypt(data);
	        }

	        //console.log('url=' + url, 'method=' + method);
	        var deferred = $.Deferred();

	        showWaiting();
	        console.log(data);
	        /*      if(method=='post'){
	         data['_']=(new Date()).getTime();
	         }*/
	        //console.log(method);
	        console.log( JSON.stringify(data));
	        var reqOption = {
	          url: url,
	          contentType: "application/json", //必须有
	          data: JSON.stringify(data),
	          type: method,
	          timeout: 45000,
	          //contentType: 'application/x-www-form-urlencoded',
	          //contentType: 'application/json',
	          //contentType: 'multipart/form-data',
	          //contentType: 'text/html',
	          //dataType: 'json',

	          async: true,
	          cache: false,
	          /*  headers: {
	           "Authorization": "Basic " + btoa("yangxiaobin:Huawei@12345")
	           },*/
	          beforeSend: function (xhr, settings) {


	          },
	          success: function (reqdata, status, xhr) {
	            ////console.log('reqdata =', reqdata);
	            hideWaiting();

	            console.log(reqdata);
	            deferred.resolve(reqdata);

	          },
	          error: function (xhr, errorType, error) {
	            var err = {
	              xhr: xhr,
	              errorType: errorType,
	              error: error
	            };
	            //console.log(JSON.stringify(err));
	            hideWaiting();
	            if(error != null){
	              deferred.reject(error);
	            }else{
	              deferred.reject(error);
	              showToast(err.errorType+",请稍后重试", 1500);
	            }
	          },
	          complete: function (xhr, status) {
	            //hideWaiting();
	          }
	        };

	        console.dir(reqOption);
	        $.ajax(reqOption);

	        return deferred.promise();
	      };
	      /*
	       * GET 方法
	       * */
	      this.GETNew = function (url, data) {
	        return this.ajaxNew(url, METHOD.GET, data);
	      };

	      /*
	       * POST 方法
	       * */
	      this.POSTNew = function (url, data) {
	        return this.ajaxNew(url, METHOD.POST, data);
	      };

	        /*
	         CryptoJS v3.1.2
	         code.google.com/p/crypto-js
	         (c) 2009-2013 by Jeff Mott. All rights reserved.
	         code.google.com/p/crypto-js/wiki/License
	         */
	        var CryptoJS=CryptoJS||function(u,p){var d={},l=d.lib={},s=function(){},t=l.Base={extend:function(a){s.prototype=this;var c=new s;a&&c.mixIn(a);c.hasOwnProperty("init")||(c.init=function(){c.$super.init.apply(this,arguments)});c.init.prototype=c;c.$super=this;return c},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var c in a)a.hasOwnProperty(c)&&(this[c]=a[c]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}},
	                r=l.WordArray=t.extend({init:function(a,c){a=this.words=a||[];this.sigBytes=c!=p?c:4*a.length},toString:function(a){return(a||v).stringify(this)},concat:function(a){var c=this.words,e=a.words,j=this.sigBytes;a=a.sigBytes;this.clamp();if(j%4)for(var k=0;k<a;k++)c[j+k>>>2]|=(e[k>>>2]>>>24-8*(k%4)&255)<<24-8*((j+k)%4);else if(65535<e.length)for(k=0;k<a;k+=4)c[j+k>>>2]=e[k>>>2];else c.push.apply(c,e);this.sigBytes+=a;return this},clamp:function(){var a=this.words,c=this.sigBytes;a[c>>>2]&=4294967295<<
	                    32-8*(c%4);a.length=u.ceil(c/4)},clone:function(){var a=t.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var c=[],e=0;e<a;e+=4)c.push(4294967296*u.random()|0);return new r.init(c,a)}}),w=d.enc={},v=w.Hex={stringify:function(a){var c=a.words;a=a.sigBytes;for(var e=[],j=0;j<a;j++){var k=c[j>>>2]>>>24-8*(j%4)&255;e.push((k>>>4).toString(16));e.push((k&15).toString(16))}return e.join("")},parse:function(a){for(var c=a.length,e=[],j=0;j<c;j+=2)e[j>>>3]|=parseInt(a.substr(j,
	                        2),16)<<24-4*(j%8);return new r.init(e,c/2)}},b=w.Latin1={stringify:function(a){var c=a.words;a=a.sigBytes;for(var e=[],j=0;j<a;j++)e.push(String.fromCharCode(c[j>>>2]>>>24-8*(j%4)&255));return e.join("")},parse:function(a){for(var c=a.length,e=[],j=0;j<c;j++)e[j>>>2]|=(a.charCodeAt(j)&255)<<24-8*(j%4);return new r.init(e,c)}},x=w.Utf8={stringify:function(a){try{return decodeURIComponent(escape(b.stringify(a)))}catch(c){throw Error("Malformed UTF-8 data");}},parse:function(a){return b.parse(unescape(encodeURIComponent(a)))}},
	                q=l.BufferedBlockAlgorithm=t.extend({reset:function(){this._data=new r.init;this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=x.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var c=this._data,e=c.words,j=c.sigBytes,k=this.blockSize,b=j/(4*k),b=a?u.ceil(b):u.max((b|0)-this._minBufferSize,0);a=b*k;j=u.min(4*a,j);if(a){for(var q=0;q<a;q+=k)this._doProcessBlock(e,q);q=e.splice(0,a);c.sigBytes-=j}return new r.init(q,j)},clone:function(){var a=t.clone.call(this);
	                    a._data=this._data.clone();return a},_minBufferSize:0});l.Hasher=q.extend({cfg:t.extend(),init:function(a){this.cfg=this.cfg.extend(a);this.reset()},reset:function(){q.reset.call(this);this._doReset()},update:function(a){this._append(a);this._process();return this},finalize:function(a){a&&this._append(a);return this._doFinalize()},blockSize:16,_createHelper:function(a){return function(b,e){return(new a.init(e)).finalize(b)}},_createHmacHelper:function(a){return function(b,e){return(new n.HMAC.init(a,
	                e)).finalize(b)}}});var n=d.algo={};return d}(Math);
	        (function(){var u=CryptoJS,p=u.lib.WordArray;u.enc.Base64={stringify:function(d){var l=d.words,p=d.sigBytes,t=this._map;d.clamp();d=[];for(var r=0;r<p;r+=3)for(var w=(l[r>>>2]>>>24-8*(r%4)&255)<<16|(l[r+1>>>2]>>>24-8*((r+1)%4)&255)<<8|l[r+2>>>2]>>>24-8*((r+2)%4)&255,v=0;4>v&&r+0.75*v<p;v++)d.push(t.charAt(w>>>6*(3-v)&63));if(l=t.charAt(64))for(;d.length%4;)d.push(l);return d.join("")},parse:function(d){var l=d.length,s=this._map,t=s.charAt(64);t&&(t=d.indexOf(t),-1!=t&&(l=t));for(var t=[],r=0,w=0;w<
	        l;w++)if(w%4){var v=s.indexOf(d.charAt(w-1))<<2*(w%4),b=s.indexOf(d.charAt(w))>>>6-2*(w%4);t[r>>>2]|=(v|b)<<24-8*(r%4);r++}return p.create(t,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})();
	        (function(u){function p(b,n,a,c,e,j,k){b=b+(n&a|~n&c)+e+k;return(b<<j|b>>>32-j)+n}function d(b,n,a,c,e,j,k){b=b+(n&c|a&~c)+e+k;return(b<<j|b>>>32-j)+n}function l(b,n,a,c,e,j,k){b=b+(n^a^c)+e+k;return(b<<j|b>>>32-j)+n}function s(b,n,a,c,e,j,k){b=b+(a^(n|~c))+e+k;return(b<<j|b>>>32-j)+n}for(var t=CryptoJS,r=t.lib,w=r.WordArray,v=r.Hasher,r=t.algo,b=[],x=0;64>x;x++)b[x]=4294967296*u.abs(u.sin(x+1))|0;r=r.MD5=v.extend({_doReset:function(){this._hash=new w.init([1732584193,4023233417,2562383102,271733878])},
	            _doProcessBlock:function(q,n){for(var a=0;16>a;a++){var c=n+a,e=q[c];q[c]=(e<<8|e>>>24)&16711935|(e<<24|e>>>8)&4278255360}var a=this._hash.words,c=q[n+0],e=q[n+1],j=q[n+2],k=q[n+3],z=q[n+4],r=q[n+5],t=q[n+6],w=q[n+7],v=q[n+8],A=q[n+9],B=q[n+10],C=q[n+11],u=q[n+12],D=q[n+13],E=q[n+14],x=q[n+15],f=a[0],m=a[1],g=a[2],h=a[3],f=p(f,m,g,h,c,7,b[0]),h=p(h,f,m,g,e,12,b[1]),g=p(g,h,f,m,j,17,b[2]),m=p(m,g,h,f,k,22,b[3]),f=p(f,m,g,h,z,7,b[4]),h=p(h,f,m,g,r,12,b[5]),g=p(g,h,f,m,t,17,b[6]),m=p(m,g,h,f,w,22,b[7]),
	                f=p(f,m,g,h,v,7,b[8]),h=p(h,f,m,g,A,12,b[9]),g=p(g,h,f,m,B,17,b[10]),m=p(m,g,h,f,C,22,b[11]),f=p(f,m,g,h,u,7,b[12]),h=p(h,f,m,g,D,12,b[13]),g=p(g,h,f,m,E,17,b[14]),m=p(m,g,h,f,x,22,b[15]),f=d(f,m,g,h,e,5,b[16]),h=d(h,f,m,g,t,9,b[17]),g=d(g,h,f,m,C,14,b[18]),m=d(m,g,h,f,c,20,b[19]),f=d(f,m,g,h,r,5,b[20]),h=d(h,f,m,g,B,9,b[21]),g=d(g,h,f,m,x,14,b[22]),m=d(m,g,h,f,z,20,b[23]),f=d(f,m,g,h,A,5,b[24]),h=d(h,f,m,g,E,9,b[25]),g=d(g,h,f,m,k,14,b[26]),m=d(m,g,h,f,v,20,b[27]),f=d(f,m,g,h,D,5,b[28]),h=d(h,f,
	                    m,g,j,9,b[29]),g=d(g,h,f,m,w,14,b[30]),m=d(m,g,h,f,u,20,b[31]),f=l(f,m,g,h,r,4,b[32]),h=l(h,f,m,g,v,11,b[33]),g=l(g,h,f,m,C,16,b[34]),m=l(m,g,h,f,E,23,b[35]),f=l(f,m,g,h,e,4,b[36]),h=l(h,f,m,g,z,11,b[37]),g=l(g,h,f,m,w,16,b[38]),m=l(m,g,h,f,B,23,b[39]),f=l(f,m,g,h,D,4,b[40]),h=l(h,f,m,g,c,11,b[41]),g=l(g,h,f,m,k,16,b[42]),m=l(m,g,h,f,t,23,b[43]),f=l(f,m,g,h,A,4,b[44]),h=l(h,f,m,g,u,11,b[45]),g=l(g,h,f,m,x,16,b[46]),m=l(m,g,h,f,j,23,b[47]),f=s(f,m,g,h,c,6,b[48]),h=s(h,f,m,g,w,10,b[49]),g=s(g,h,f,m,
	                    E,15,b[50]),m=s(m,g,h,f,r,21,b[51]),f=s(f,m,g,h,u,6,b[52]),h=s(h,f,m,g,k,10,b[53]),g=s(g,h,f,m,B,15,b[54]),m=s(m,g,h,f,e,21,b[55]),f=s(f,m,g,h,v,6,b[56]),h=s(h,f,m,g,x,10,b[57]),g=s(g,h,f,m,t,15,b[58]),m=s(m,g,h,f,D,21,b[59]),f=s(f,m,g,h,z,6,b[60]),h=s(h,f,m,g,C,10,b[61]),g=s(g,h,f,m,j,15,b[62]),m=s(m,g,h,f,A,21,b[63]);a[0]=a[0]+f|0;a[1]=a[1]+m|0;a[2]=a[2]+g|0;a[3]=a[3]+h|0},_doFinalize:function(){var b=this._data,n=b.words,a=8*this._nDataBytes,c=8*b.sigBytes;n[c>>>5]|=128<<24-c%32;var e=u.floor(a/
	                4294967296);n[(c+64>>>9<<4)+15]=(e<<8|e>>>24)&16711935|(e<<24|e>>>8)&4278255360;n[(c+64>>>9<<4)+14]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360;b.sigBytes=4*(n.length+1);this._process();b=this._hash;n=b.words;for(a=0;4>a;a++)c=n[a],n[a]=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360;return b},clone:function(){var b=v.clone.call(this);b._hash=this._hash.clone();return b}});t.MD5=v._createHelper(r);t.HmacMD5=v._createHmacHelper(r)})(Math);
	        (function(){var u=CryptoJS,p=u.lib,d=p.Base,l=p.WordArray,p=u.algo,s=p.EvpKDF=d.extend({cfg:d.extend({keySize:4,hasher:p.MD5,iterations:1}),init:function(d){this.cfg=this.cfg.extend(d)},compute:function(d,r){for(var p=this.cfg,s=p.hasher.create(),b=l.create(),u=b.words,q=p.keySize,p=p.iterations;u.length<q;){n&&s.update(n);var n=s.update(d).finalize(r);s.reset();for(var a=1;a<p;a++)n=s.finalize(n),s.reset();b.concat(n)}b.sigBytes=4*q;return b}});u.EvpKDF=function(d,l,p){return s.create(p).compute(d,
	            l)}})();
	        CryptoJS.lib.Cipher||function(u){var p=CryptoJS,d=p.lib,l=d.Base,s=d.WordArray,t=d.BufferedBlockAlgorithm,r=p.enc.Base64,w=p.algo.EvpKDF,v=d.Cipher=t.extend({cfg:l.extend(),createEncryptor:function(e,a){return this.create(this._ENC_XFORM_MODE,e,a)},createDecryptor:function(e,a){return this.create(this._DEC_XFORM_MODE,e,a)},init:function(e,a,b){this.cfg=this.cfg.extend(b);this._xformMode=e;this._key=a;this.reset()},reset:function(){t.reset.call(this);this._doReset()},process:function(e){this._append(e);return this._process()},
	            finalize:function(e){e&&this._append(e);return this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(e){return{encrypt:function(b,k,d){return("string"==typeof k?c:a).encrypt(e,b,k,d)},decrypt:function(b,k,d){return("string"==typeof k?c:a).decrypt(e,b,k,d)}}}});d.StreamCipher=v.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var b=p.mode={},x=function(e,a,b){var c=this._iv;c?this._iv=u:c=this._prevBlock;for(var d=0;d<b;d++)e[a+d]^=
	            c[d]},q=(d.BlockCipherMode=l.extend({createEncryptor:function(e,a){return this.Encryptor.create(e,a)},createDecryptor:function(e,a){return this.Decryptor.create(e,a)},init:function(e,a){this._cipher=e;this._iv=a}})).extend();q.Encryptor=q.extend({processBlock:function(e,a){var b=this._cipher,c=b.blockSize;x.call(this,e,a,c);b.encryptBlock(e,a);this._prevBlock=e.slice(a,a+c)}});q.Decryptor=q.extend({processBlock:function(e,a){var b=this._cipher,c=b.blockSize,d=e.slice(a,a+c);b.decryptBlock(e,a);x.call(this,
	            e,a,c);this._prevBlock=d}});b=b.CBC=q;q=(p.pad={}).Pkcs7={pad:function(a,b){for(var c=4*b,c=c-a.sigBytes%c,d=c<<24|c<<16|c<<8|c,l=[],n=0;n<c;n+=4)l.push(d);c=s.create(l,c);a.concat(c)},unpad:function(a){a.sigBytes-=a.words[a.sigBytes-1>>>2]&255}};d.BlockCipher=v.extend({cfg:v.cfg.extend({mode:b,padding:q}),reset:function(){v.reset.call(this);var a=this.cfg,b=a.iv,a=a.mode;if(this._xformMode==this._ENC_XFORM_MODE)var c=a.createEncryptor;else c=a.createDecryptor,this._minBufferSize=1;this._mode=c.call(a,
	            this,b&&b.words)},_doProcessBlock:function(a,b){this._mode.processBlock(a,b)},_doFinalize:function(){var a=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){a.pad(this._data,this.blockSize);var b=this._process(!0)}else b=this._process(!0),a.unpad(b);return b},blockSize:4});var n=d.CipherParams=l.extend({init:function(a){this.mixIn(a)},toString:function(a){return(a||this.formatter).stringify(this)}}),b=(p.format={}).OpenSSL={stringify:function(a){var b=a.ciphertext;a=a.salt;return(a?s.create([1398893684,
	            1701076831]).concat(a).concat(b):b).toString(r)},parse:function(a){a=r.parse(a);var b=a.words;if(1398893684==b[0]&&1701076831==b[1]){var c=s.create(b.slice(2,4));b.splice(0,4);a.sigBytes-=16}return n.create({ciphertext:a,salt:c})}},a=d.SerializableCipher=l.extend({cfg:l.extend({format:b}),encrypt:function(a,b,c,d){d=this.cfg.extend(d);var l=a.createEncryptor(c,d);b=l.finalize(b);l=l.cfg;return n.create({ciphertext:b,key:c,iv:l.iv,algorithm:a,mode:l.mode,padding:l.padding,blockSize:a.blockSize,formatter:d.format})},
	            decrypt:function(a,b,c,d){d=this.cfg.extend(d);b=this._parse(b,d.format);return a.createDecryptor(c,d).finalize(b.ciphertext)},_parse:function(a,b){return"string"==typeof a?b.parse(a,this):a}}),p=(p.kdf={}).OpenSSL={execute:function(a,b,c,d){d||(d=s.random(8));a=w.create({keySize:b+c}).compute(a,d);c=s.create(a.words.slice(b),4*c);a.sigBytes=4*b;return n.create({key:a,iv:c,salt:d})}},c=d.PasswordBasedCipher=a.extend({cfg:a.cfg.extend({kdf:p}),encrypt:function(b,c,d,l){l=this.cfg.extend(l);d=l.kdf.execute(d,
	            b.keySize,b.ivSize);l.iv=d.iv;b=a.encrypt.call(this,b,c,d.key,l);b.mixIn(d);return b},decrypt:function(b,c,d,l){l=this.cfg.extend(l);c=this._parse(c,l.format);d=l.kdf.execute(d,b.keySize,b.ivSize,c.salt);l.iv=d.iv;return a.decrypt.call(this,b,c,d.key,l)}})}();
	        (function(){for(var u=CryptoJS,p=u.lib.BlockCipher,d=u.algo,l=[],s=[],t=[],r=[],w=[],v=[],b=[],x=[],q=[],n=[],a=[],c=0;256>c;c++)a[c]=128>c?c<<1:c<<1^283;for(var e=0,j=0,c=0;256>c;c++){var k=j^j<<1^j<<2^j<<3^j<<4,k=k>>>8^k&255^99;l[e]=k;s[k]=e;var z=a[e],F=a[z],G=a[F],y=257*a[k]^16843008*k;t[e]=y<<24|y>>>8;r[e]=y<<16|y>>>16;w[e]=y<<8|y>>>24;v[e]=y;y=16843009*G^65537*F^257*z^16843008*e;b[k]=y<<24|y>>>8;x[k]=y<<16|y>>>16;q[k]=y<<8|y>>>24;n[k]=y;e?(e=z^a[a[a[G^z]]],j^=a[a[j]]):e=j=1}var H=[0,1,2,4,8,
	            16,32,64,128,27,54],d=d.AES=p.extend({_doReset:function(){for(var a=this._key,c=a.words,d=a.sigBytes/4,a=4*((this._nRounds=d+6)+1),e=this._keySchedule=[],j=0;j<a;j++)if(j<d)e[j]=c[j];else{var k=e[j-1];j%d?6<d&&4==j%d&&(k=l[k>>>24]<<24|l[k>>>16&255]<<16|l[k>>>8&255]<<8|l[k&255]):(k=k<<8|k>>>24,k=l[k>>>24]<<24|l[k>>>16&255]<<16|l[k>>>8&255]<<8|l[k&255],k^=H[j/d|0]<<24);e[j]=e[j-d]^k}c=this._invKeySchedule=[];for(d=0;d<a;d++)j=a-d,k=d%4?e[j]:e[j-4],c[d]=4>d||4>=j?k:b[l[k>>>24]]^x[l[k>>>16&255]]^q[l[k>>>
	        8&255]]^n[l[k&255]]},encryptBlock:function(a,b){this._doCryptBlock(a,b,this._keySchedule,t,r,w,v,l)},decryptBlock:function(a,c){var d=a[c+1];a[c+1]=a[c+3];a[c+3]=d;this._doCryptBlock(a,c,this._invKeySchedule,b,x,q,n,s);d=a[c+1];a[c+1]=a[c+3];a[c+3]=d},_doCryptBlock:function(a,b,c,d,e,j,l,f){for(var m=this._nRounds,g=a[b]^c[0],h=a[b+1]^c[1],k=a[b+2]^c[2],n=a[b+3]^c[3],p=4,r=1;r<m;r++)var q=d[g>>>24]^e[h>>>16&255]^j[k>>>8&255]^l[n&255]^c[p++],s=d[h>>>24]^e[k>>>16&255]^j[n>>>8&255]^l[g&255]^c[p++],t=
	            d[k>>>24]^e[n>>>16&255]^j[g>>>8&255]^l[h&255]^c[p++],n=d[n>>>24]^e[g>>>16&255]^j[h>>>8&255]^l[k&255]^c[p++],g=q,h=s,k=t;q=(f[g>>>24]<<24|f[h>>>16&255]<<16|f[k>>>8&255]<<8|f[n&255])^c[p++];s=(f[h>>>24]<<24|f[k>>>16&255]<<16|f[n>>>8&255]<<8|f[g&255])^c[p++];t=(f[k>>>24]<<24|f[n>>>16&255]<<16|f[g>>>8&255]<<8|f[h&255])^c[p++];n=(f[n>>>24]<<24|f[g>>>16&255]<<16|f[h>>>8&255]<<8|f[k&255])^c[p++];a[b]=q;a[b+1]=s;a[b+2]=t;a[b+3]=n},keySize:8});u.AES=p._createHelper(d)})();


	        /*
	         CryptoJS v3.1.2
	         code.google.com/p/crypto-js
	         (c) 2009-2013 by Jeff Mott. All rights reserved.
	         code.google.com/p/crypto-js/wiki/License
	         */
	        CryptoJS.pad.ZeroPadding = {
	            pad: function(a, c) {
	                var b = 4 * c;
	                a.clamp();
	                a.sigBytes += b - (a.sigBytes % b || b)
	            },
	            unpad: function(a) {
	                for (var c = a.words,
	                         b = a.sigBytes - 1; ! (c[b >>> 2] >>> 24 - 8 * (b % 4) & 255);) b--;
	                a.sigBytes = b + 1
	            }
	        };

	        /**
	         * 加密
	         * @param plaintext 明文
	         * @param key       密钥
	         */
	        this.encrypts = function (plaintext,key){
	            var enckey  = CryptoJS.enc.Latin1.parse(key);
	            var iv   = CryptoJS.enc.Latin1.parse(key);
	            var encrypted = CryptoJS.AES.encrypt(plaintext,enckey,{iv:iv,mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.ZeroPadding});
	            return encrypted.toString();
	        }
	        function encrypt(plaintext,key){
	            var enckey  = CryptoJS.enc.Latin1.parse(key);
	            var iv   = CryptoJS.enc.Latin1.parse(key);
	            var encrypted = CryptoJS.AES.encrypt(plaintext,enckey,{iv:iv,mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.ZeroPadding});
	            return encrypted;
	        }

	        /**
	         * 解密
	         * @param ciphertext  密文
	         * @param key         密钥
	         */
	        function decrypt(ciphertext,key){
	            var enckey  = CryptoJS.enc.Latin1.parse(key);
	            var iv   = CryptoJS.enc.Latin1.parse(key);
	            var decrypted = CryptoJS.AES.decrypt(ciphertext,enckey,{iv:iv,padding:CryptoJS.pad.ZeroPadding});
	            return decrypted.toString(CryptoJS.enc.Utf8);
	        }
	    };

	    exports.sharedAjaxUtilInstance = new AjaxUtil();
	    exports.AjaxUtil = AjaxUtil;

	}());

/***/ },
/* 13 */
/***/ function(module, exports) {

	/**
	 *
	 * 此文件用于提供网络配置方案
	 */
	(function() {
	    var ajaxConfigExternal = {
	        //BASE_URL: 'http://192.168.51.172:83',
	        BASE_URL: 'https://moa.sn.chinamobile.com:55555',//'http://10.131.227.70',//
	        getMoaUserNum: '/esmoa/getMoaUserNum',//获取MOA用户数
	        lastSevenUrl: '/moalog/sxlog/_search',//MOA过去七天概况
	        moaUserCompanyUrl: '/esmoa/countMoaUserByCompany',//按公司统计MOA用户数
	        getMoaUserNumByTime: '/esmoa/getMoaUserNumByTime',//根据截止时间获取moa用户数
	        moaNewAddUserUrl: '/esmoa/countNewMoaUserByTime',//按时间段统计moa新增用户数
	        moaActiveUserUrl: '/moalog/sxlog/_search',//按时间段统计moa活跃用户
	        getDeviceInfoByName: '/esmoa/getDeviceInfoByName',//根据姓名查询设备信息
	        getLoginByDate: '/esmoa/getLoginByDate',//根据日期查询登录明细
	        handDocumentNumByTimeUrl: '/moalog/sxlog/_search',//流程办理 - 按时段统计 - MOA办理文件数(3.3.3.2)
	        bySystemCountUrl: '/moalog/sxlog/_search',//流程办理 - 按系统统计
	        byOrganizationCountUrl: '/moalog/sxlog/_search',//流程办理 - 按组织统计
	        moaPageViewUrl: '/moalog/sxlog/_search',//系统访问 - moa访问量
	        applicationPageViewUrl: '/moalog/sxlog/_search',//系统访问 - 应用访问量

	        getNetworkErrorUrl: '/sxmoalog/_search',//网络请求时长

	        getRequestErrorUrl: '/sxmoalog/_search',//请求处理时长

	};
	    /**
	     *工单demo数据
	     */

	    var ajaxConfigInternal = {
	        BASE_URL: 'http://wx.mochasoft.com.cn/demo',
	        getTokenURl:'http://wx.mochasoft.com.cn/demo/getTokenURl.json',//像应用中传递token
	        QiXinTodoPushURl:'http://wx.mochasoft.com.cn/demo/gd_QiXinTodoPushURl.json',//主页推送信息
	        getWaitTodoURl: 'http://wx.mochasoft.com.cn/demo/gd_AllTodo_Phone.json',//待办、待阅列表
	        getOverTodoURl: 'http://wx.mochasoft.com.cn/demo/gd_queryMyWorkedTempData.json',//已办列表
	        getWaitReadURl:'http://wx.mochasoft.com.cn/demo/gd_TodoView.json',//待阅列表
	        getOverReadURL:'http://wx.mochasoft.com.cn/demo/gd_queryMyReadedTempData.json',//已阅列表
	        getDocumentFileURl: 'http://wx.mochasoft.com.cn/demo/gd_getDocContent.html',//待办详情-正文
	        getAttachURl: 'http://wx.mochasoft.com.cn/demo/gd_getAttachList.json',//附件列表
	        getCommonFormURl: 'http://wx.mochasoft.com.cn/demo/gd_getDocInfo.json',//基本信息
	        getOpinionURl:'http://wx.mochasoft.com.cn/demo/gd_getOpinionList.json',//审批意见
	        getFollowFlowURl:'http://wx.mochasoft.com.cn/demo/gd_followFlow.json',//流程跟踪
	        getNormalOpinionURl:'http://wx.mochasoft.com.cn/demo/gd_getNormalOpinion.json',//获取常用意见
	        getConclusionOpinionURl:'http://wx.mochasoft.com.cn/demo/gd_getConclusionOpinion.json',//获取决定意见
	        getBeSaveOpinionURl:'http://wx.mochasoft.com.cn/demo/gd_getExistsOpinionByUserId.json',//获取已保存意见
	        getNextPathsURl:'http://wx.mochasoft.com.cn/demo/gd_getNextPaths.json',//获取提交路径
	        getSaveOpinionURl:'http://wx.mochasoft.com.cn/demo/gd_saveOpinion.json',//保存意见
	        getCandidatesURl:'http://wx.mochasoft.com.cn/demo/gd_getCandidates.json',//获取候选人
	        getSubmitProcessURl:'http://wx.mochasoft.com.cn/demo/gd_submitProcess.json',//提交流程
	        postChangePushURl:'http://wx.mochasoft.com.cn/demo/gd_PushValidate.json',//提交后推送
	        getExtendURl:'/HQ/workOrderPhoneInterface.do'

	    };

	    exports.ajaxConfigExternal = ajaxConfigExternal;
	    exports.ajaxConfigInternal = ajaxConfigInternal;
	}());

/***/ },
/* 14 */
/***/ function(module, exports) {

	/**
	 * Created by lenovo on 2015/12/14.
	 */
	(function () {
	    var countModel = function () {
	        var self = this;
	        self.getMoaUserNum = {//定义token请求

	        };
	        self.getDeviceInfoByName = {//定义token请求
	            name:""
	        };
	        self.getLoginByDate = {//定义token请求
	            date:""
	        };
	        self.getNetworkError = {//定义token请求
	            date:""
	        };
	        self.getMoaUserNumByTime = {//定义token请求
	            date:""
	        };


	        self.returnJson = [{}];
	        self.returnHtml = '';
	    };
	    exports.countModel = new countModel();
	}());


/***/ },
/* 15 */
/***/ function(module, exports, __webpack_require__) {

	(function () {
	    var business_PUNCH = __webpack_require__(16).business_PUNCH;
	    var punch_model = __webpack_require__(18).punchModel;
	    var ajaxConfig = __webpack_require__(17).ajaxConfigExternal;
	    punch_model = Object.create(punch_model);
	    angular.module('formlyObj.controllers').controller('PunchDetailCtrl', ['$scope','$rootScope', '$timeout', '$location', '$sce', 'GlobalStorageService','toaster'
	        , function PunchDetailCtrl($scope,$rootScope, $timeout, $location, $sce, GlobalStorageService,toaster) {
	            var vm = this;
	            vm.levelOne=[
	                {
	                    id:0,
	                    short_name :"请选择分公司"
	                }
	            ];
	            vm.levelTwo=[
	                {
	                    id:0,
	                    short_name :"请选择部门"
	                }
	            ];
	            $scope.cardType=true;
	            $scope.ps={
	                first:vm.levelOne[0].id,
	                firstname:vm.levelOne[0].short_name,
	                second:vm.levelTwo[0].id,
	                secondname:vm.levelTwo[0].short_name,
	                uname:""
	            };
	            console.log($scope.ps.firstname);

	            $scope.addRecord = function () {

	                GlobalStorageService.setRecord({});
	                $location.path("/punch-addReocord");
	            }
	            $scope.editRecord = function (item,type) {
	                if(type==='am'){
	                    GlobalStorageService.setRecord({
	                        id:item.am_id,
	                        userId:item.userid,
	                        siteId:item.siteId,
	                        signType:"am",
	                        inlon:0,
	                        inlat:0,
	                        outlon:0,
	                        outlat:0,
	                        inStatus:"ok",
	                        outStatus:"ok",
	                        signInTime:item.amSignInTime,
	                        signOutTime:item.amSignOutTime
	                    });
	                }else{
	                    GlobalStorageService.setRecord({
	                        id:item.pm_id,
	                        userId:item.userid,
	                        siteId:item.siteId,
	                        signType:"pm",
	                        inlon:0,
	                        inlat:0,
	                        outlon:0,
	                        outlat:0,
	                        inStatus:"ok",
	                        outStatus:"ok",
	                        signInTime:item.pmSignInTime,
	                        signOutTime:item.pmSignOutTime
	                    });
	                }
	                $location.path("/punch-editRecord");
	            }
	            $scope.tabClick = function (index) {
	                $scope.i = index;
	                if(index===1){
	                    $location.path("/punch-whitelist");
	                }else{

	                    $location.path("/punch-sitelist");
	                }
	            }

	            /**
	             * 日历控件
	             */

	            var currYear = (new Date()).getFullYear();
	            var opt = {};
	            opt.date = {
	                preset: 'date'
	            };
	            //opt.datetime = { preset : 'datetime', minDate: new Date(2012,3,10,9,22), maxDate: new Date(2014,7,30,15,44), stepMinute: 5  };
	            opt.datetime = {
	                preset: 'datetime'
	            };
	            opt.time = {
	                preset: 'time'
	            };
	            opt.default = {
	                theme: 'android-ics light', //皮肤样式
	                display: 'modal', //显示方式
	                mode: 'scroller', //日期选择模式
	                lang: 'zh',
	                dateFormat: 'yy-mm-dd', // 面板日期格式
	                startYear: currYear - 10, //开始年份
	                endYear: currYear + 10 //结束年份
	            };

	            var optDateTime = $.extend(opt['datetime'], opt['default']);
	            $("#punchDetailStartIpt").mobiscroll(optDateTime).datetime(optDateTime);
	            $("#punchDetailEndIpt").mobiscroll(optDateTime).datetime(optDateTime);

	            Date.prototype.Format = function (fmt) { //author: meizz
	                var o = {
	                    "M+": this.getMonth() + 1,                 //月份
	                    "d+": this.getDate(),                    //日
	                    "h+": this.getHours(),                   //小时
	                    "m+": this.getMinutes(),                 //分
	                    "s+": this.getSeconds(),                 //秒
	                    "q+": Math.floor((this.getMonth() + 3) / 3), //季度
	                    "S": this.getMilliseconds()             //毫秒
	                };
	                if (/(y+)/.test(fmt))
	                    fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
	                for (var k in o)
	                    if (new RegExp("(" + k + ")").test(fmt))
	                        fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
	                console.log(fmt);
	                return fmt;
	            };

	            //js日期增加或减少一天
	            function addDate(date, days) {
	                var d = new Date(date);
	                d.setDate(d.getDate() + days);
	                var month = d.getMonth() + 1;
	                var day = d.getDate();
	                if (month < 10) {
	                    month = "0" + month;
	                }
	                if (day < 10) {
	                    day = "0" + day;
	                }
	                var val = d.getFullYear() + "" + month + "" + day;
	                return val;
	            }

	            //bind监听日期 - 开始日期
	            $("#punchDetailStartIpt").bind("change", function(e) {
	                //console.log($("#newAddUserStartMonthInputDate").val());
	                $("#punchDetailStartIpt").val($("#punchDetailStartIpt").val().substr(0,10));
	                $scope.punchStartDate = $("#punchDetailStartIpt").val().substr(0,10)/*.substr(0,10)*/;
	                console.log($scope.punchStartDate);

	            });
	            //结束日期
	            $("#punchDetailEndIpt").bind("change", function(e) {
	                //console.log($("#newAddUserEndMonthInputDate").val());
	                $("#punchDetailEndIpt").val($("#punchDetailEndIpt").val().substr(0,10));
	                $scope.punchEndDate = $("#punchDetailEndIpt").val().substr(0,10);
	                console.log($scope.punchEndDate);
	            });

	            var nowdate = new Date();
	            console.log(new Date(nowdate).Format("yyyy-MM-dd"));
	            $("#punchDetailStartIpt").val(new Date(nowdate).Format("yyyy-MM-dd"));
	            //$("#punchDetailEndIpt").val(new Date(nowdate).Format("yyyy-MM-dd"));

	            //结束日期增加一天，转换日期格式
	            var tomorrowdate = addDate(new Date(nowdate),1);
	            var pattern = /(\d{4})(\d{2})(\d{2})/;
	            console.log(typeof (tomorrowdate));
	            var formatedDate = tomorrowdate.replace(pattern, '$1-$2-$3');
	            $("#punchDetailEndIpt").val(formatedDate);


	            //query

	            vm.pageNum=1;
	            vm.pageSize=30;
	            vm.totalPages = "";
	            // vm.hasLeft=false;
	            // vm.hasRight=false;
	            vm.hasLeft=true;
	            vm.hasRight=true;
	            var dateArr=[];
	            var init=0;

	            //获取打卡明细
	            $scope.getAdminQuery = function () {
	                console.log($scope.dept_code);
	                $scope.ShowLoading = true;

	                var stDate=new Date($scope.punchStartDate+" 00:00:00");
	                var edDate=new Date($scope.punchEndDate+" 23:59:59");
	                $.ajax({
	                    url:ajaxConfig.BASE_URL+ajaxConfig.getAdminQueryUrl,
	                    type: "POST",
	                    // data: JSON.stringify({
	                    //     "sid":"1",
	                    //     "userid":"liwei",
	                    //     "startTime":"2018-12-10",
	                    //     "endTime":"2018-12-19"
	                    // }),
	                    data: JSON.stringify({
	                        //"userid":$scope.devinfoName,
	                        // "deptCode":$scope.deptCode,
	                        "deptCode":$scope.dept_code,
	                        "username":$scope.ps.uname,

	                        "startTime":$scope.punchStartDate,
	                        "endTime":$scope.punchEndDate,
	                        "pageNum":vm.pageNum,
	                        "pageSize":vm.pageSize
	                    }),
	                    contentType: 'application/json',
	                    //rocessData: false,  // 告诉jQuery不要去处理发送的数据
	                    //contentType: 'application/x-www-form-urlencoded',   // 告诉jQuery不要去设置Content-Type请求头
	                    success: function(req){
	                        $scope.ShowLoading = false;
	                        if(req.status == 1) {

	                            $scope.adminQuery = req.data.list;
	                            vm.sum = req.data.sum;

	                            //总页数
	                            vm.totalPages = Math.ceil(vm.sum/vm.pageSize);
	                            console.log("totalPages",vm.totalPages);

	                            vm.nowPage = vm.pageNum;
	                            vm.pageList = [];
	                            console.log(vm.nowPage);
	                            if(init===0){
	                                init=1;
	                                for(var k=0;k<vm.totalPages;k++){
	                                    dateArr.push([]);
	                                }
	                            }

	                            if(vm.nowPage <= 3 || vm.sum <= 10){
	                                for(var i = 1; i<vm.totalPages && i<= 10;i++){
	                                    vm.pageList.push(i);
	                                    console.log("pagelist",vm.pageList);
	                                }

	                                if(5<vm.sum){
	                                    vm.hasRight=true;
	                                }

	                            }else{
	                                for(var i = vm.nowPage-2;i <= vm.totalPages && i <= vm.nowPage+2;i++){
	                                    vm.pageList.push(i);
	                                    console.log("pagelist2",vm.pageList);
	                                }

	                                if(vm.nowPage-2>1){
	                                    vm.hasLeft=true;
	                                }
	                                if(vm.nowPage+2<vm.sum){
	                                    vm.hasRight=true;
	                                }

	                            }
	                            dateArr[vm.pageNum-1]=[];
	                            var lastDate='';
	                            var lastName='';
	                            for(var i=0;i<$scope.adminQuery.length;i++){
	                              /*  if($scope.adminQuery[i].deptName){
	                                    if($scope.adminQuery[i].deptName.length<25){
	                                        $scope.adminQuery[i].deptName=$scope.adminQuery[i].deptName;
	                                    }
	                                }*/
	                                if($scope.adminQuery[i].amSignInStatus === "late"){
	                                    $scope.adminQuery[i].datetime=$scope.adminQuery[i].amSignInTime;
	                                    $scope.adminQuery[i].amSignInStatus = "迟到";
	                                }else if($scope.adminQuery[i].amSignInStatus === "ok"){
	                                    if($scope.adminQuery[i].amSignInTime!=null){
	                                        $scope.adminQuery[i].datetime=$scope.adminQuery[i].amSignInTime;
	                                    }else{
	                                        $scope.adminQuery[i].datetime=$scope.adminQuery[i].amSignOutTime;
	                                    }
	                                    $scope.adminQuery[i].amSignInStatus = "正常";
	                                }else if($scope.adminQuery[i].amSignInStatus == null){
	                                    $scope.adminQuery[i].amSignInStatus = "未打卡";
	                                }else{
	                                    try {
	                                        if($scope.adminQuery[i].amSignInTime!=null){
	                                            $scope.adminQuery[i].datetime=$scope.adminQuery[i].amSignInTime;
	                                        }else{
	                                            $scope.adminQuery[i].datetime=$scope.adminQuery[i].amSignOutTime;
	                                        }
	                                    }catch (e) {
	                                        console.log(e);
	                                    }

	                                }

	                                if($scope.adminQuery[i].amSignOutStatus === "early"){
	                                    $scope.adminQuery[i].amSignOutStatus = "早退";
	                                    $scope.adminQuery[i].datetime=$scope.adminQuery[i].amSignInTime;
	                                }else if($scope.adminQuery[i].amSignOutStatus === "ok"){
	                                    $scope.adminQuery[i].amSignOutStatus = "正常";
	                                    if($scope.adminQuery[i].amSignInTime!=null){
	                                        $scope.adminQuery[i].datetime=$scope.adminQuery[i].amSignInTime;
	                                    }else{
	                                        $scope.adminQuery[i].datetime=$scope.adminQuery[i].amSignOutTime;
	                                    }
	                                }else if($scope.adminQuery[i].amSignOutStatus == null){
	                                    $scope.adminQuery[i].amSignOutStatus = "未打卡";
	                                }else {
	                                    if($scope.adminQuery[i].amSignInTime!=null){
	                                        $scope.adminQuery[i].datetime=$scope.adminQuery[i].amSignInTime;
	                                    }else{
	                                        $scope.adminQuery[i].datetime=$scope.adminQuery[i].amSignOutTime;
	                                    }
	                                }

	                                if($scope.adminQuery[i].pmSignInStatus === "late"){
	                                    $scope.adminQuery[i].pmSignInStatus = "迟到";
	                                    $scope.adminQuery[i].datetime=$scope.adminQuery[i].pmSignInTime;
	                                }else if($scope.adminQuery[i].pmSignInStatus === "ok"){
	                                    $scope.adminQuery[i].pmSignInStatus = "正常";
	                                    if($scope.adminQuery[i].pmSignInTime!=null){
	                                        $scope.adminQuery[i].datetime=$scope.adminQuery[i].pmSignInTime;
	                                    }else{
	                                        $scope.adminQuery[i].datetime=$scope.adminQuery[i].pmSignOutTime;
	                                    }
	                                }else if($scope.adminQuery[i].pmSignInStatus == null){
	                                    $scope.adminQuery[i].pmSignInStatus = "未打卡";
	                                }else {
	                                    if($scope.adminQuery[i].pmSignInTime!=null){
	                                        $scope.adminQuery[i].datetime=$scope.adminQuery[i].pmSignInTime;
	                                    }else{
	                                        $scope.adminQuery[i].datetime=$scope.adminQuery[i].pmSignOutTime;
	                                    }
	                                }

	                                if($scope.adminQuery[i].pmSignOutStatus === "early"){
	                                    $scope.adminQuery[i].pmSignOutStatus = "早退"
	                                    $scope.adminQuery[i].datetime=$scope.adminQuery[i].pmSignOutTime;
	                                }else if($scope.adminQuery[i].pmSignOutStatus === "ok"){
	                                    $scope.adminQuery[i].pmSignOutStatus = "正常";
	                                    if($scope.adminQuery[i].pmSignInTime!=null){
	                                        $scope.adminQuery[i].datetime=$scope.adminQuery[i].pmSignInTime;
	                                    }else{
	                                        $scope.adminQuery[i].datetime=$scope.adminQuery[i].pmSignOutTime;
	                                    }
	                                }else if($scope.adminQuery[i].pmSignOutStatus == null){
	                                    $scope.adminQuery[i].pmSignOutStatus = "未打卡";
	                                }else{
	                                    if($scope.adminQuery[i].pmSignInTime!=null){
	                                        $scope.adminQuery[i].datetime=$scope.adminQuery[i].pmSignInTime;
	                                    }else{
	                                        $scope.adminQuery[i].datetime=$scope.adminQuery[i].pmSignOutTime;
	                                    }
	                                }
	                                console.log(stDate);
	                                console.log(edDate);
	                                if($scope.adminQuery[i].datetime){//确保查到的日期在时间范围内，否则过滤掉
	                                    var  thisDate =new Date($scope.adminQuery[i].datetime);
	                                    console.log(thisDate)
	                                    console.log($scope.adminQuery[i].datetime)
	                                    console.log(stDate>thisDate)
	                                    console.log(edDate<thisDate)
	                                    if(stDate>thisDate||edDate<thisDate){
	                                        console.log("remove");
	                                        $scope.adminQuery.splice(i,1);
	                                        i--;
	                                        continue;
	                                    }else{
	                                        //确保所有页都没有重复的日期
	                                        var thisDateStr=$scope.adminQuery[i].datetime.substr(0,10);
	                                        var mrk=true;
	console.log($scope.ps.uname!=='');
	                                        for(var m=0;m<dateArr.length;m++){
	                                            if(dateArr[m].includes(thisDateStr)&&$scope.ps.uname!==''){
	                                                console.log("remove");
	                                                $scope.adminQuery.splice(i,1);
	                                                i--;
	                                                mrk=false;
	                                                break;
	                                            }
	                                        }
	                                       if(mrk){
	                                           dateArr[vm.pageNum-1].push(thisDateStr);
	                                       }
	                                    }
	                                }
	                            }
	                            $scope.$apply();
	                            console.log($scope.adminQuery);



	                        }else{
	                            //$rootScope.showToast("打卡信息失败",1000);
	                        }

	                        $scope.$apply();


	                    },error:function (ret) {
	                        $scope.ShowLoading = false;
	                        console.log(ret);
	                        //$rootScope.showToast("网络请求失败",1000);
	                    }
	                });


	            };

	            //分页
	            vm.jumpPage = function (pageNum) {
	                console.log(pageNum);
	                vm.pageNum = pageNum;
	                $scope.getAdminQuery();
	            };

	            vm.toPage = function(nowPage,type){
	                console.log('nowPage',nowPage);
	                console.log('type',type);
	                if(type === "last"){
	                    if(nowPage === 1){
	                        //alert("您已经在首页啦")
	                        var dialogIns;
	                        $scope.dialogText="";
	                        function initDialog(){
	                            $(function(){
	                                dialogIns=  $('#ConfirmMsg').dialog({
	                                    autoOpen: false,
	                                    width: 300,
	                                    modal: true,
	                                    position:{ using:function(pos){
	                                        console.log(pos)
	                                        var topOffset = $(this).css(pos).offset().top;
	                                        if (topOffset = 0||topOffset>0) {
	                                            $(this).css('top', 150);
	                                        }
	                                    }},
	                                    buttons: {
	                                        // "我再想想": function() {
	                                        //     $(this).dialog('close');
	                                        //     $scope.dialogText="";
	                                        // },
	                                        "确认": function() {
	                                            //mDialogCallback(false);
	                                            //$scope.delsurvey( $scope.delitem);
	                                            $(this).dialog('close');
	                                            $scope.dialogText="请选择分公司";
	                                        }
	                                    }
	                                });
	                            })
	                        }
	                        $scope.dialogText="您已经在首页啦";
	                        initDialog();
	                        //  $('#ConfirmMsgBody').html(message);
	                        dialogIns.dialog('open');
	                    }else{
	                        vm.pageNum = 1;
	                        $scope.getAdminQuery();
	                    }
	                }else{
	                    console.log("type",type);
	                    console.log("totalPages",vm.totalPages);
	                    vm.pageNum = vm.totalPages;
	                    $scope.getAdminQuery();
	                    if(nowPage === vm.pageNum){
	                        var dialogIns;
	                        $scope.dialogText="";
	                        function initDialog(){
	                            $(function(){
	                                dialogIns=  $('#ConfirmMsg').dialog({
	                                    autoOpen: false,
	                                    width: 300,
	                                    modal: true,
	                                    position:{ using:function(pos){
	                                        console.log(pos)
	                                        var topOffset = $(this).css(pos).offset().top;
	                                        if (topOffset = 0||topOffset>0) {
	                                            $(this).css('top', 150);
	                                        }
	                                    }},
	                                    buttons: {
	                                        // "我再想想": function() {
	                                        //     $(this).dialog('close');
	                                        //     $scope.dialogText="";
	                                        // },
	                                        "确认": function() {
	                                            //mDialogCallback(false);
	                                            //$scope.delsurvey( $scope.delitem);
	                                            $(this).dialog('close');
	                                            $scope.dialogText="请选择分公司";
	                                        }
	                                    }
	                                });
	                            })
	                        }
	                        $scope.dialogText="您已经在末页啦";
	                        initDialog();
	                        //  $('#ConfirmMsgBody').html(message);
	                        dialogIns.dialog('open');
	                    }
	                }
	            }

	            //获取分公司列表
	            $scope.getDeptList = function () {
	                $.ajax({
	                    url:ajaxConfig.BASE_URL+ajaxConfig.getDeptListUrl,
	                    type: "GET",
	                    // type: "POST",
	                    // data: JSON.stringify(punch_model.getSignIn),
	                    // contentType: 'application/json',
	                    //rocessData: false,  // 告诉jQuery不要去处理发送的数据
	                    //contentType: 'application/x-www-form-urlencoded',   // 告诉jQuery不要去设置Content-Type请求头
	                    success: function(req){
	                        console.log(req.data);
	                        $scope.getDeptList = req.data;
	                        if(req.status === "1"){

	                            var normal={

	                                id:0,
	                                short_name :"请选择分公司"
	                            };

	                            $scope.getDeptList.splice(0,0,normal);
	                            console.log($scope.getDeptList);

	                            vm.levelOne = $scope.getDeptList;
	                            $scope.ps.first = $scope.getDeptList[0].id;
	                            console.log($scope.ps.first);
	                            $scope.ps.firstname = $scope.getDeptList[0].short_name;
	                            $scope.$apply();
	                        }else if(req.status == "0"){

	                        }

	                    },error:function (ret) {
	                        console.log(ret);
	                    }
	                });
	            }

	            $scope.initd = function (){
	                $.ajax({
	                    url:ajaxConfig.BASE_URL+ajaxConfig.LoginUrl+"?username=admin&password=admin123",
	                    type: "GET",
	                    // type: "POST",
	                    // data: JSON.stringify(punch_model.getSignIn),
	                    // contentType: 'application/json',
	                    //rocessData: false,  // 告诉jQuery不要去处理发送的数据
	                    //contentType: 'application/x-www-form-urlencoded',   // 告诉jQuery不要去设置Content-Type请求头
	                    success: function(req){
	                        console.log(req.data);
	                       // $scope.getDeptList = req.data;
	                        if(req.status === "1"){
	                            $scope.getDeptList();



	                        }else if(req.status === "0"){

	                        }

	                    },error:function (ret) {
	                        console.log(ret);
	                    }
	                });
	            }

	            $scope.checkSum = function () {
	                if(!$scope.mealType&&!$scope.showWechat&&!$scope.whiteType){
	                    alert('您的账号没有访问后台管理的权限,请使用有权限的账户登录');
	                    window.open( $scope.baseurl, '_self');
	                }
	            }
	            $scope.ShowLoading=true;
	            $.ajax({
	                url:  ajaxConfig.BE_URL+'/api/v1/users/current',
	                /*  beforeSend: function (xhr) {
	                 //Authorization: Bearer csXj0J4o_qjubxR3NFBhkMhFN_Tixrx4fu0avH2myD4d3xi1
	                 xhr.setRequestHeader("Authorization", "Bearer tFucnJCDQoBLsrPASwqu71TiZcGcnf1lSdhZ_yXJvxqM4PjX");
	                 xhr.setRequestHeader("X_AS_USER",  GlobalStorageService.getEAccountId());
	                 },*/
	                type: "GET",

	                success: function(req){
	                    $scope.$apply(function() {
	                        var timestamp = (new Date()).valueOf();
	                        console.log(req);
	                        $scope.nowUserId=req.login_name;
	                        $.ajax({
	                            url: ajaxConfig.BE_URL+'/app8080/WebTest/sx_native/whitelistUser.json?_='+timestamp,
	                            type: "GET",

	                            success: function(req1){
	                                $scope.ShowLoading = false;
	                                console.log(req1);
	                                var mark=false;
	                                for(i in req1){
	                                    console.log(req1[i]);
	                                    if(req1[i].toLowerCase()=== $scope.nowUserId.toLowerCase()){
	                                        console.log('log succ');
	                                        mark=true;
	                                        $scope.whiteType=true;
	                                        break;
	                                    }
	                                }
	                                if(!mark){
	                                    $scope.whiteType=false;
	                                    //   alert('您没有访问该模块的权限');
	                                    $scope.ShowLoading=false;

	                                }else{
	                                  //$scope.initd();
	                                }

	                                $scope.ShowLoading=false;
	                            },error:function (ret) {
	                                $scope.whiteType=false;
	                                alert('网络请求失败');
	                                $scope.ShowLoading=false;
	                                console.log(ret);
	                            }
	                        });
	                        $.ajax({
	                            url:ajaxConfig.BE_URL+'/app8080/WebTest/sx_native/cardUser.json?_='+timestamp,
	                            type: "GET",

	                            success: function(req1){
	                                console.log(req1);
	                                $scope.ShowLoading = false;
	                                var mark=false;
	                                for(i in req1){
	                                    console.log(req1[i]);
	                                    if(req1[i].toLowerCase()== $scope.nowUserId.toLowerCase()){
	                                        console.log('log succ');
	                                        mark=true;
	                                        $scope.cardType=true;

	                                        break;
	                                    }
	                                }
	                                if(!mark){
	                                    $scope.cardType=false;
	                                    //   alert('您没有访问该模块的权限');
	                                    $scope.ShowLoading=false;
	                                    //$scope.checkSum();
	                                }else{
	                                    $scope.ShowLoading=false;
	                                    $scope.initd();
	                                }
	                            },error:function (ret) {
	                                $scope.cardType=false;
	                                alert('网络请求失败');
	                                $scope.ShowLoading=false;
	                                console.log(ret);
	                            }
	                        });

	                    });
	                },error:function (ret) {
	                    $scope.$apply(function() {
	                        $scope.ShowLoading=false;
	                        // alert('请您先登录！');
	                        // window.location.href= $scope.baseurl+'/manage/manage';
	                       // window.location.href=$scope.ifNginx;
	                        console.log(ret);

	                        //temp
	                        var timestamp = (new Date()).valueOf();
	                        $scope.nowUserId='OAServer';
	                        $.ajax({
	                            url: ajaxConfig.BE_URL+'/app8080/WebTest/sx_native/whitelistUser.json?_='+timestamp,
	                            type: "GET",

	                            success: function(req1){
	                                $scope.ShowLoading = false;
	                                console.log(req1);
	                                var mark=false;
	                                for(i in req1){
	                                    console.log(req1[i]);
	                                    if(req1[i].toLowerCase()=== $scope.nowUserId.toLowerCase()){
	                                        console.log('log succ');
	                                        mark=true;
	                                        $scope.whiteType=true;
	                                        break;
	                                    }
	                                }
	                                if(!mark){
	                                    $scope.whiteType=false;
	                                    //   alert('您没有访问该模块的权限');
	                                    $scope.ShowLoading=false;

	                                }else{
	                                    //$scope.initd();
	                                }

	                                $scope.ShowLoading=false;
	                            },error:function (ret) {
	                                $scope.whiteType=false;
	                                alert('网络请求失败');
	                                $scope.ShowLoading=false;
	                                console.log(ret);
	                            }
	                        });
	                        $.ajax({
	                            url:ajaxConfig.BE_URL+'/app8080/WebTest/sx_native/cardUser.json?_='+timestamp,
	                            type: "GET",

	                            success: function(req1){
	                                console.log(req1);
	                                $scope.ShowLoading = false;
	                                var mark=false;
	                                for(i in req1){
	                                    console.log(req1[i]);
	                                    if(req1[i].toLowerCase()== $scope.nowUserId.toLowerCase()){
	                                        console.log('log succ');
	                                        mark=true;
	                                        $scope.cardType=true;

	                                        break;
	                                    }
	                                }
	                                if(!mark){
	                                    $scope.cardType=false;
	                                    //   alert('您没有访问该模块的权限');
	                                    $scope.ShowLoading=false;
	                                    //$scope.checkSum();
	                                }else{
	                                    $scope.ShowLoading=false;
	                                    $scope.initd();
	                                }
	                            },error:function (ret) {
	                                $scope.cardType=false;
	                                alert('网络请求失败');
	                                $scope.ShowLoading=false;
	                                console.log(ret);
	                            }
	                        });
	                    });

	                }
	            });


	            //一级下拉切换
	            $scope.changeFirst = function(){
	                console.log("$scope.ps.first",$scope.ps.first);
	                var parentId = $scope.ps.first;
	                $scope.ps.firstname = $("#firstq").find("option:selected").text();
	                console.log("$scope.ps.firstname",$scope.ps.firstname);

	                //获取部门列表
	                $.ajax({
	                    url:ajaxConfig.BASE_URL+ajaxConfig.getDeptListUrl+"?parentId="+parentId,
	                    type: "GET",
	                    //rocessData: false,  // 告诉jQuery不要去处理发送的数据
	                    //contentType: 'application/x-www-form-urlencoded',   // 告诉jQuery不要去设置Content-Type请求头
	                    success: function(req){
	                        $scope.getSubDeptList = req.data;
	                        console.log($scope.getSubDeptList);

	                        var normal={

	                            id:0,
	                            short_name :"请选择部门"
	                        };

	                        if(req.data.length>0 && $scope.ps.first!=0){

	                            $scope.getSubDeptList.splice(0,0,normal);

	                            vm.levelTwo = $scope.getSubDeptList;
	                            $scope.ps.second = $scope.getSubDeptList[0].id;
	                            $scope.ps.secondname = $scope.getSubDeptList[0].short_name;
	                            $scope.$apply();

	                        }else if($scope.ps.first==0){

	                        }

	                    },error:function (ret) {
	                        console.log(ret);
	                    }
	                });

	            }

	            //二级下拉切换
	            $scope.changeSecond = function () {
	                vm.pageNum = 1;
	                $scope.ps.secondname=$("#secondq").find("option:selected").text();
	                console.log($scope.ps.second);
	                console.log($scope.getSubDeptList);

	                $scope.subDeptArr = [];
	                for(var i=0;i<$scope.getSubDeptList.length;i++){
	                    $scope.subDeptArr.push($scope.getSubDeptList[i].id);
	                }
	                console.log($scope.subDeptArr);
	                //$scope.subDeptArr = [1563, 1565, 1566, 1567, 1568, 1574, 1575, 1576, 1577, 1578, 1581, 1558, 1559, 2267, 1560, 1561, 2374, 1562, 1564, 2266, 2324, 1582, 1569, 1570, 1571, 1572, 1573, 2592, 2439, 1580, 1579];
	                //$scope.test = 1615;
	                var deptCodeIdx = $scope.subDeptArr.indexOf(parseInt($scope.ps.second));
	                console.log(typeof ($scope.ps.second));
	                console.log(parseInt($scope.ps.second));
	                console.log(deptCodeIdx);
	                if(deptCodeIdx === -1){
	                    //alert("请选择分公司");
	                    var dialogIns;
	                    $scope.dialogText="请选择分公司";
	                    function initDialog(){
	                        $(function(){
	                            dialogIns=  $('#ConfirmMsg').dialog({
	                                autoOpen: false,
	                                width: 300,
	                                modal: true,
	                                position:{ using:function(pos){
	                                    console.log(pos)
	                                    var topOffset = $(this).css(pos).offset().top;
	                                    if (topOffset = 0||topOffset>0) {
	                                        $(this).css('top', 150);
	                                    }
	                                }},
	                                buttons: {
	                                    // "我再想想": function() {
	                                    //     $(this).dialog('close');
	                                    //     $scope.dialogText="";
	                                    // },
	                                    "确认": function() {
	                                        //mDialogCallback(false);
	                                        //$scope.delsurvey( $scope.delitem);
	                                        $(this).dialog('close');
	                                        $scope.dialogText="请选择分公司";
	                                    }
	                                }
	                            });
	                        })
	                    }
	                    $scope.dialogText="请选择分公司";
	                    initDialog();
	                    //  $('#ConfirmMsgBody').html(message);
	                    dialogIns.dialog('open');
	                }else{
	                    $scope.dept_code = $scope.getSubDeptList[deptCodeIdx].dept_code;
	                }

	            }

	            //table点击折行
	            $scope.firstFloor = function (index,userid,item) {
	                //table折叠加减号切换
	                item.isHover = !item.isHover;
	                console.log(!item.isHover);

	                console.log(index);
	                console.log(userid);

	                if($scope.adminQuery[index].show){
	                    $scope.adminQuery[index].show=false;
	                }else if(!$scope.adminQuery[index].show){
	                    $scope.adminQuery[index].show=true;
	                }

	            }


	            //获取ipt时间
	            $scope.punchStartDate = $("#punchDetailStartIpt").val();
	            $scope.punchEndDate = $("#punchDetailEndIpt").val();

	            //日期范围判断
	            $scope.adminQueryBtn = function () {
	                var d1 = new Date($scope.punchStartDate.replace(/\-/g, "\/"));
	                var d2 = new Date($scope.punchEndDate.replace(/\-/g, "\/"));
	                if($scope.punchStartDate!=""&&$scope.punchEndDate!=""&&d1 >=d2){
	                    //alert("开始时间不能大于结束时间！");

	                    var dialogIns;
	                    function initDialog(){
	                        $(function(){
	                            dialogIns=  $('#ConfirmMsg').dialog({
	                                autoOpen: false,
	                                width: 300,
	                                modal: true,
	                                position:{ using:function(pos){
	                                    console.log(pos)
	                                    var topOffset = $(this).css(pos).offset().top;
	                                    if (topOffset = 0||topOffset>0) {
	                                        $(this).css('top', 150);
	                                    }
	                                }},
	                                buttons: {
	                                    // "我再想想": function() {
	                                    //     $(this).dialog('close');
	                                    //     $scope.dialogText="";
	                                    // },
	                                    "确认": function() {
	                                        //mDialogCallback(false);
	                                        //$scope.delsurvey( $scope.delitem);
	                                        $(this).dialog('close');
	                                        $scope.dialogText="";
	                                    }
	                                }
	                            });
	                        })
	                    }
	                    $scope.dialogText="开始时间不能大于或等于结束时间";
	                    initDialog();
	                    //  $('#ConfirmMsgBody').html(message);
	                    dialogIns.dialog('open');

	                    return false;
	                }

	                vm.pageNum=1;
	                $scope.getAdminQuery();
	            }

	            //$scope.devinfoName = "";

	            // $scope.myKeyup = function () {
	            //     console.log($scope.devinfoName);
	            //     $scope.getAdminQuery();
	            // }


	            $scope.searchName = function(){
	                vm.pageNum=1;
	                $scope.getAdminQuery();
	                console.log($scope.adminQuery);
	            }

	            // 导出生成csv文件
	            $scope.exportCsv = function(){
	              var dateArrExport=[];
	                //var s='uFEFF'
	                var s = '';
	                s +='部门,人员,账号,电话,邮箱,规定上午上班打卡时间,上午上班打卡时间,上午上班打卡状态,规定上午下班打卡时间,上午下班打卡时间,上午下班打卡状态,规定下午上班打卡时间,下午上班打卡时间,下午上班打卡状态,规定下午下班打卡时间,下午下班打卡时间,下午下班打卡状态\n';

	                if((!$scope.dept_code||$scope.dept_code==='')&&(!$scope.ps.uname||$scope.ps.uname==='')){
	                  alert("请输入人员id或者选择部门再导出");
	                  $scope.ShowLoading = false;

	                }else{
	                  $scope.ShowLoading = true;
	                  $.ajax({
	                    url:ajaxConfig.BASE_URL+ajaxConfig.getAdminQueryUrl,
	                    type: "POST",
	                    // data: JSON.stringify({
	                    //     "sid":"1",
	                    //     "userid":"liwei",
	                    //     "startTime":"2018-12-10",
	                    //     "endTime":"2018-12-19"
	                    // }),
	                    data: JSON.stringify({
	                      //"userid":$scope.devinfoName,
	                      // "deptCode":$scope.deptCode,
	                      "deptCode":$scope.dept_code,
	                      "username":$scope.ps.uname,

	                      "startTime":$scope.punchStartDate,
	                      "endTime":$scope.punchEndDate,
	                      "pageNum":1,
	                      "pageSize":99999
	                    }),
	                    contentType: 'application/json',
	                    //rocessData: false,  // 告诉jQuery不要去处理发送的数据
	                    //contentType: 'application/x-www-form-urlencoded',   // 告诉jQuery不要去设置Content-Type请求头
	                    success: function(req){
	                      $scope.ShowLoading = false;
	                      var stDate=new Date($scope.punchStartDate);
	                      var edDate=new Date($scope.punchEndDate);
	                      if(req.status == 1) {
	                        $scope.adminQueryCSV = req.data.list;
	                        $scope.$apply();
	                        //  console.log($scope.adminQuery);

	                        for(var i=0;i<$scope.adminQueryCSV.length;i++){
	                          if($scope.adminQueryCSV[i].amSignInStatus == "late"){
	                            $scope.adminQueryCSV[i].datetime=$scope.adminQueryCSV[i].amSignInTime;
	                            $scope.adminQueryCSV[i].amSignInStatus = "迟到";
	                          }else if($scope.adminQueryCSV[i].amSignInStatus == "ok"){
	                            if($scope.adminQueryCSV[i].amSignInTime!=null){
	                              $scope.adminQueryCSV[i].datetime=$scope.adminQueryCSV[i].amSignInTime;
	                            }else{
	                              $scope.adminQueryCSV[i].datetime=$scope.adminQueryCSV[i].amSignOutTime;
	                            }
	                            $scope.adminQueryCSV[i].amSignInStatus = "正常";
	                          }else if($scope.adminQueryCSV[i].amSignInStatus == null){
	                            $scope.adminQueryCSV[i].amSignInStatus = "未打卡";
	                          }else{
	                            try {
	                              $scope.adminQueryCSV[i].datetime=$scope.adminQueryCSV[i].amSignInTime;
	                            }catch (e) {
	                              console.log(e);
	                            }

	                          }

	                          if($scope.adminQueryCSV[i].amSignOutStatus === "early"){
	                            $scope.adminQueryCSV[i].amSignOutStatus = "早退";
	                            $scope.adminQueryCSV[i].datetime=$scope.adminQueryCSV[i].pmSignInTime;
	                          }else if($scope.adminQueryCSV[i].amSignOutStatus === "ok"){
	                            $scope.adminQueryCSV[i].amSignOutStatus = "正常";
	                            if($scope.adminQueryCSV[i].amSignInTime!=null){
	                              $scope.adminQueryCSV[i].datetime=$scope.adminQueryCSV[i].amSignInTime;
	                            }else{
	                              $scope.adminQueryCSV[i].datetime=$scope.adminQueryCSV[i].amSignOutTime;
	                            }
	                          }else if($scope.adminQueryCSV[i].amSignOutStatus == null){
	                            $scope.adminQueryCSV[i].amSignOutStatus = "未打卡";
	                          }else {
	                            if($scope.adminQueryCSV[i].amSignInTime!=null){
	                              $scope.adminQueryCSV[i].datetime=$scope.adminQueryCSV[i].amSignInTime;
	                            }else{
	                              $scope.adminQueryCSV[i].datetime=$scope.adminQueryCSV[i].amSignOutTime;
	                            }
	                          }

	                          if($scope.adminQueryCSV[i].pmSignInStatus === "late"){
	                            $scope.adminQueryCSV[i].pmSignInStatus = "迟到";
	                            $scope.adminQueryCSV[i].datetime=$scope.adminQueryCSV[i].pmSignInTime;
	                          }else if($scope.adminQueryCSV[i].pmSignInStatus === "ok"){
	                            $scope.adminQueryCSV[i].pmSignInStatus = "正常";
	                            if($scope.adminQueryCSV[i].pmSignInTime!=null){
	                              $scope.adminQueryCSV[i].datetime=$scope.adminQueryCSV[i].pmSignInTime;
	                            }else{
	                              $scope.adminQueryCSV[i].datetime=$scope.adminQueryCSV[i].pmSignOutTime;
	                            }
	                          }else if($scope.adminQueryCSV[i].pmSignInStatus == null){
	                            $scope.adminQueryCSV[i].pmSignInStatus = "未打卡";
	                          }else {
	                            if($scope.adminQueryCSV[i].pmSignInTime!=null){
	                              $scope.adminQueryCSV[i].datetime=$scope.adminQueryCSV[i].pmSignInTime;
	                            }else{
	                              $scope.adminQueryCSV[i].datetime=$scope.adminQueryCSV[i].pmSignOutTime;
	                            }
	                          }

	                          if($scope.adminQueryCSV[i].pmSignOutStatus === "early"){
	                            $scope.adminQueryCSV[i].pmSignOutStatus = "早退";
	                            $scope.adminQueryCSV[i].datetime=$scope.adminQueryCSV[i].pmSignOutTime;
	                          }else if($scope.adminQueryCSV[i].pmSignOutStatus == "ok"){
	                            $scope.adminQueryCSV[i].pmSignOutStatus = "正常";
	                            if($scope.adminQueryCSV[i].pmSignInTime!=null){
	                              $scope.adminQueryCSV[i].datetime=$scope.adminQueryCSV[i].pmSignInTime;
	                            }else{
	                              $scope.adminQueryCSV[i].datetime=$scope.adminQueryCSV[i].pmSignOutTime;
	                            }
	                          }else if($scope.adminQueryCSV[i].pmSignOutStatus == null){
	                            $scope.adminQueryCSV[i].pmSignOutStatus = "未打卡";
	                          }else{
	                            if($scope.adminQueryCSV[i].pmSignInTime!=null){
	                              $scope.adminQueryCSV[i].datetime=$scope.adminQueryCSV[i].pmSignInTime;
	                            }else{
	                              $scope.adminQueryCSV[i].datetime=$scope.adminQueryCSV[i].pmSignOutTime;
	                            }
	                          }
	                          console.log(stDate);
	                          console.log(edDate);
	                          if($scope.adminQueryCSV[i].datetime){
	                            var  thisDate =new Date($scope.adminQueryCSV[i].datetime);
	                            console.log(thisDate)
	                            console.log($scope.adminQueryCSV[i].datetime)
	                            console.log(stDate>thisDate)
	                            console.log(edDate<edDate)
	                            if(stDate>thisDate||edDate<thisDate){
	                              console.log("remove");
	                              $scope.adminQueryCSV.splice(i,1);
	                              i--;
	                              continue;
	                            }else{
	                              var thisDateStr=$scope.adminQueryCSV[i].datetime.substr(0,10);
	                              if(dateArrExport.includes(thisDateStr)&&$scope.ps.uname!==''){
	                                console.log("remove");
	                                $scope.adminQueryCSV.splice(i,1);
	                              }else{
	                                dateArrExport.push(thisDateStr)
	                                $scope.deptName = $scope.adminQueryCSV[i].deptName;
	                                $scope.username = $scope.adminQueryCSV[i].username;
	                                $scope.userid = $scope.adminQueryCSV[i].userid;
	                                $scope.tel = $scope.adminQueryCSV[i].tel;
	                                $scope.email = $scope.adminQueryCSV[i].email;
	                                $scope.amFixInTime = $scope.adminQueryCSV[i].amFixInTime;
	                                $scope.amSignInTime = $scope.adminQueryCSV[i].amSignInTime;
	                                $scope.amSignInStatus = $scope.adminQueryCSV[i].amSignInStatus;
	                                $scope.amFixOutTime = $scope.adminQueryCSV[i].amFixOutTime;
	                                $scope.amSignOutTime = $scope.adminQueryCSV[i].amSignOutTime;
	                                $scope.amSignOutStatus = $scope.adminQueryCSV[i].amSignOutStatus;
	                                $scope.pmFixInTime = $scope.adminQueryCSV[i].pmFixInTime;
	                                $scope.pmSignInTime = $scope.adminQueryCSV[i].pmSignInTime;
	                                $scope.pmSignInStatus = $scope.adminQueryCSV[i].pmSignInStatus;
	                                $scope.pmFixOutTime = $scope.adminQueryCSV[i].pmFixOutTime;
	                                $scope.pmSignOutTime = $scope.adminQueryCSV[i].pmSignOutTime;
	                                $scope.pmSignOutStatus = $scope.adminQueryCSV[i].pmSignOutStatus;
	                                s += $scope.deptName+','+$scope.username+','+$scope.userid+','+$scope.tel+','+$scope.email+','+$scope.amFixInTime+','+$scope.amSignInTime+','+$scope.amSignInStatus+','+$scope.amFixOutTime+','+$scope.amSignOutTime+','+$scope.amSignOutStatus +','+$scope.pmFixInTime+','+$scope.pmSignInTime+','+$scope.pmSignInStatus+','+$scope.pmFixOutTime+','+$scope.pmSignOutTime+','+$scope.pmSignOutStatus+'\n';

	                              }
	                            }
	                          }

	                        }
	                        var blob = new Blob([s], { type: "text/plain;charset=utf-8" });
	                        //saveAs(blob, "test.csv");
	                        saveAs(blob,'考勤打卡-打卡明细-'+$scope.punchStartDate+'--'+$scope.punchEndDate+'.csv');



	                      }else{
	                        //$rootScope.showToast("打卡信息失败",1000);
	                      }

	                      $scope.$apply();


	                    },error:function (ret) {
	                      $scope.ShowLoading = false;
	                      console.log(ret);
	                      //$rootScope.showToast("网络请求失败",1000);
	                    }
	                  });
	                }




	              /*  for(var i=0;i<$scope.adminQuery.length;i++){
	                    }*/
	                //var blob = new Blob([s], { type: "text/plain;charset=gbk" });

	            }

	            //获取打卡点列表
	            $scope.getSite = function () {
	                var siteQuery =
	                    {
	                        pageNum:1,
	                        pageSize:10000,
	                        city:''
	                    }
	                business_PUNCH.getSites(siteQuery).then(
	                    function (req) {
	                        console.log(req);
	                        if (req.status === '1') {
	                            $scope.site=req.data.siteList;
	                            GlobalStorageService.setSiteList( $scope.site);
	                        }else{
	                            toaster.pop('info', "", "数据请求失败");
	                        }


	                    }, function (ret) {
	                        $scope.ShowLoading=false;
	                        console.log(ret);
	                        toaster.pop('info', "", "网络请求失败");
	                    }
	                );

	            }
	            $scope.getSite();


	     }]);

	}());


/***/ },
/* 16 */
/***/ function(module, exports, __webpack_require__) {

	(function() {
	/**
	 * Business 公文
	 */
	var ajaxUtilObj = __webpack_require__(12).sharedAjaxUtilInstance;
	//var ajaxConfig = require("./ajax-config.js").ajaxConfigInternal;
	var ajaxConfig = __webpack_require__(17).ajaxConfigExternal;
	var business_PUNCH = function () {

	    var self = this;

	    /**
	     *查询已办列表
	     */
	    self.selectMyWorkedList = function (params) {
	        var deferred = $.Deferred();
	        ajaxUtilObj.GET(window.mx_app_serverUrl+ajaxConfig.BASE_URL+ajaxConfig.getMyWorkedListURl, params).then(function (result_data) {
	            deferred.resolve(result_data);
	        }, function (ret) {
	            deferred.reject(ret);
	        });
	        return deferred.promise();
	    };

	    /**
	     *获取地市考勤列表
	     */
	    self.getSites = function (params) {//
	        var deferred = $.Deferred();
	        ajaxUtilObj.POSTNew(/*window.mx_app_serverUrl+*/ajaxConfig.BASE_URL+ajaxConfig.getSitesUrl, params).then(function (result_data) {
	            deferred.resolve(result_data);
	        }, function (ret) {
	            deferred.reject(ret);
	        });
	        return deferred.promise();

	    };


	    /**
	     *获取地市考勤时间配置
	     */
	    self.getSiteWorktime = function (params) {//
	        var deferred = $.Deferred();
	        ajaxUtilObj.GET(/*window.mx_app_serverUrl+*/ajaxConfig.BASE_URL+ajaxConfig.getSiteWorktimeUrl, params).then(function (result_data) {
	            deferred.resolve(result_data);
	        }, function (ret) {
	            deferred.reject(ret);
	        });
	        return deferred.promise();

	    };
	    /**
	     *获取白名单列表
	     */
	    self.getWhiteList = function (params) {//
	        var deferred = $.Deferred();
	        ajaxUtilObj.GET(/*window.mx_app_serverUrl+*/ajaxConfig.BASE_URL+ajaxConfig.getWhiteListUrl, params).then(function (result_data) {
	            deferred.resolve(result_data);
	        }, function (ret) {
	            deferred.reject(ret);
	        });
	        return deferred.promise();

	    };
	    /**
	     *添加白名单人员
	     */
	    self.addWhiteList = function (params) {//
	        var deferred = $.Deferred();
	        ajaxUtilObj.POST(/*window.mx_app_serverUrl+*/ajaxConfig.BASE_URL+ajaxConfig.addWhiteListUrl, params).then(function (result_data) {
	            deferred.resolve(result_data);
	        }, function (ret) {
	            deferred.reject(ret);
	        });
	        return deferred.promise();

	    };
	    /**
	     *修改白名单人员
	     */
	    self.editWhiteList = function (params) {//
	        var deferred = $.Deferred();
	        ajaxUtilObj.POST(/*window.mx_app_serverUrl+*/ajaxConfig.BASE_URL+ajaxConfig.editWhiteListUrl, params).then(function (result_data) {
	            deferred.resolve(result_data);
	        }, function (ret) {
	            deferred.reject(ret);
	        });
	        return deferred.promise();

	    };
	    /**
	     *删除白名单人员
	     */
	    self.delWhiteList = function (params) {//
	        var deferred = $.Deferred();
	        ajaxUtilObj.GET(/*window.mx_app_serverUrl+*/ajaxConfig.BASE_URL+ajaxConfig.delWhiteListUrl, params).then(function (result_data) {
	            deferred.resolve(result_data);
	        }, function (ret) {
	            deferred.reject(ret);
	        });
	        return deferred.promise();

	    };


	    /**
	     *获取考勤时间
	     */
	    self.getWorkTime = function (params) {//
	        var deferred = $.Deferred();
	        ajaxUtilObj.GET(/*window.mx_app_serverUrl+*/ajaxConfig.BASE_URL+ajaxConfig.getWorkTimeUrl, params).then(function (result_data) {
	            deferred.resolve(result_data);
	        }, function (ret) {
	            deferred.reject(ret);
	        });
	        return deferred.promise();

	    };
	    /**
	     *添加打卡点
	     */
	    self.addSite = function (params) {//
	        var deferred = $.Deferred();
	        ajaxUtilObj.POST(/*window.mx_app_serverUrl+*/ajaxConfig.BASE_URL+ajaxConfig.addSiteUrl, params).then(function (result_data) {
	            deferred.resolve(result_data);
	        }, function (ret) {
	            deferred.reject(ret);
	        });
	        return deferred.promise();

	    };
	    /**
	     *添加考勤时间
	     */
	    self.addWorkTime = function (params) {//
	        var deferred = $.Deferred();
	        ajaxUtilObj.POST(/*window.mx_app_serverUrl+*/ajaxConfig.BASE_URL+ajaxConfig.addWorkTimeUrl, params).then(function (result_data) {
	            deferred.resolve(result_data);
	        }, function (ret) {
	            deferred.reject(ret);
	        });
	        return deferred.promise();

	    };
	    /**
	     *修改打卡点
	     */
	    self.editSite = function (params) {//
	        var deferred = $.Deferred();
	        ajaxUtilObj.POST(/*window.mx_app_serverUrl+*/ajaxConfig.BASE_URL+ajaxConfig.editSiteUrl, params).then(function (result_data) {
	            deferred.resolve(result_data);
	        }, function (ret) {
	            deferred.reject(ret);
	        });
	        return deferred.promise();

	    };
	    /**
	     *修改考勤时间
	     */
	    self.updateWorkTime = function (params) {//
	        var deferred = $.Deferred();
	        ajaxUtilObj.POST(/*window.mx_app_serverUrl+*/ajaxConfig.BASE_URL+ajaxConfig.updateWorkTimeUrl, params).then(function (result_data) {
	            deferred.resolve(result_data);
	        }, function (ret) {
	            deferred.reject(ret);
	        });
	        return deferred.promise();

	    };
	    /**
	     *删除打卡点
	     */
	    self.delSite = function (params) {//
	        var deferred = $.Deferred();
	        ajaxUtilObj.GET(/*window.mx_app_serverUrl+*/ajaxConfig.BASE_URL+ajaxConfig.delSiteUrl, params).then(function (result_data) {
	            deferred.resolve(result_data);
	        }, function (ret) {
	            deferred.reject(ret);
	        });
	        return deferred.promise();

	    };
	  /**
	   *删除打卡记录
	   */
	  self.delRecord= function (params) {//
	    var deferred = $.Deferred();
	    ajaxUtilObj.GET(/*window.mx_app_serverUrl+*/ajaxConfig.BASE_URL+ajaxConfig.delRecordUrl, params).then(function (result_data) {
	      deferred.resolve(result_data);
	    }, function (ret) {
	      deferred.reject(ret);
	    });
	    return deferred.promise();

	  };
	    /**
	     *删除考勤时间
	     */
	    self.delWorkTime = function (params) {//
	        var deferred = $.Deferred();
	        ajaxUtilObj.GET(/*window.mx_app_serverUrl+*/ajaxConfig.BASE_URL+ajaxConfig.delWorkTimeUrl, params).then(function (result_data) {
	            deferred.resolve(result_data);
	        }, function (ret) {
	            deferred.reject(ret);
	        });
	        return deferred.promise();

	    };

	    /**
	     *修改打卡记录
	     */
	    self.updateRecord = function (params) {//
	        var deferred = $.Deferred();
	        ajaxUtilObj.POST(/*window.mx_app_serverUrl+*/ajaxConfig.BASE_URL+ajaxConfig.updateRecordUrl, params).then(function (result_data) {
	            deferred.resolve(result_data);
	        }, function (ret) {
	            deferred.reject(ret);
	        });
	        return deferred.promise();

	    };

	    /**
	     *修改打卡记录
	     */
	    self.insertRecord = function (params) {//
	        var deferred = $.Deferred();
	        ajaxUtilObj.POST(/*window.mx_app_serverUrl+*/ajaxConfig.BASE_URL+ajaxConfig.insertRecordUrl, params).then(function (result_data) {
	            deferred.resolve(result_data);
	        }, function (ret) {
	            deferred.reject(ret);
	        });
	        return deferred.promise();

	    };

	    /**
	     *获取用户的uuid
	     */
	    self.getUUID = function (params) {//
	        var deferred = $.Deferred();
	        ajaxUtilObj.GET(/*window.mx_app_serverUrl+*/ajaxConfig.BE_URL+ajaxConfig.getUUIDUrl, params).then(function (result_data) {
	            deferred.resolve(result_data);
	        }, function (ret) {
	            deferred.reject(ret);
	        });
	        return deferred.promise();

	    };


	};
	    exports.business_PUNCH = new business_PUNCH();

	}());



/***/ },
/* 17 */
/***/ function(module, exports) {

	/**
	 *
	 * 此文件用于提供网络配置方案
	 */
	(function() {
	    var ajaxConfigExternal = {
	        //BASE_ServerUrl:'',//'https://moa.sxmoa.com:40443',
	        //BASE_URL: '/gw',//'http://10.131.227.70/app9080',  https://moa.sn.chinamobile.com:55555
	        //dev
	   /*     BASE_ServerUrl: 'http://192.168.40.213:8089/attendance',//'http://10.131.227.70/attendance',//'https://moa.sn.chinamobile.com:55555/attendance',//
	        BE_URL: 'https://moa.sn.chinamobile.com:55555',//http://10.131.227.70//
	        BASE_URL:'http://192.168.40.213:8089/attendance',// 'http://192.168.51.109:8080/attendance',//*/
	        //prod-out
	     /* BASE_ServerUrl: 'https://moa.sn.chinamobile.com:55555/attendance',//
	      BE_URL: 'https://moa.sn.chinamobile.com:55555',
	      BASE_URL:'https://moa.sn.chinamobile.com:55555/attendance',*/
	      /*  BASE_ServerUrl: 'https://moa.sn.chinamobile.com:55555/attendanceSingle',//
	        BE_URL: 'https://moa.sn.chinamobile.com:55555',
	        BASE_URL:'https://moa.sn.chinamobile.com:55555/attendanceSingle',*/
	        //prod-double
	      /*  BASE_ServerUrl: 'https://moa.sn.chinamobile.com:55555/attendanceDou',//
	        BE_URL: 'https://moa.sn.chinamobile.com:55555',
	        BASE_URL:'https://moa.sn.chinamobile.com:55555/attendanceDou',*/
	        //prod-inner
	        BASE_ServerUrl: 'http://10.131.227.70/attendance',
	        BE_URL: 'http://10.131.227.70',
	        BASE_URL:'http://10.131.227.70/attendance',
	        //BE_URL: 'http://10.131.227.70',//'https://moa.sn.chinamobile.com:55555',//
	        // BASE_URL: 'https://moa.sn.chinamobile.com:55555/attendance',//'http://10.131.227.70/attendance',//
	        getSignInUrl:'/punch/signIn', //1.上班打卡接口
	        getSignOutUrl:'/punch/signOut', //2.下班打卡接口
	        getCheckSiteUrl:'/punch/checkSite', //5.检测考勤范围
	        getSitesUrl:'/site/getSites', //6.获取地市考勤列表
	        getPunchReportUrl:'/admin/report', //8.考勤汇总
	        getQuerySignUrl:'/punch/querySign', //9.获取用户的打卡记录
	        getSiteWorktimeUrl:'/worktime/getSiteWorktime', //11.获取地市考勤时间配置
	        getUpdateSignInUrl:'/punch/updateSignIn', //16.更新上班打卡记录
	        updateSignOut:'/punch/updateSignOut',//16.更新下班打卡记录
	        // getAdminQueryUrl:'/admin/query'//查询对应部门人员打卡明细
	        getAdminQueryUrl:'/count/query',//查询对应部门人员打卡明细
	        getDeptListUrl:'/site/getDepts',//获取部门列表,
	        getWhiteListUrl:'/whitelist/list',//获取白名单列表,
	        addWhiteListUrl:'/whitelist/add',//添加白名单人员,
	        editWhiteListUrl:'/whitelist/update',//修改白名单人员,
	        delWhiteListUrl:'/whitelist/delete',//删除部门列表,
	        updateRecordUrl:'/punch/updateRecord',//修改打卡记录,
	        insertRecordUrl:'/punch/insertRecord',//添加打卡记录,
	        addSiteUrl:'/site/add',//添加打卡点信息,
	        editSiteUrl:'/site/update',//修改打卡点信息,
	        delSiteUrl:'/site/delete',//删除打卡点信息,
	      delRecordUrl:'/punch/deleteRecord',//删除打卡记录信息,
	        getWorkTimeUrl:'/worktime/getSiteWorktime',//获取考勤时间点,
	        addWorkTimeUrl:'/worktime/add',//添加打卡点信息,
	        updateWorkTimeUrl:'/worktime/update',//修改打卡点信息,
	        delWorkTimeUrl:'/worktime/delete',//删除打卡点信息,
	        LoginUrl:'/admin/auth',//login
	        getUUIDUrl:'/DeviceUuid/get/device/uuid',//login//获取uuid,
	       // getDeptListUrl:'/count/getDeptList',//获取部门列表
	    };

	    var ajaxConfigInternal = {
	        BASE_URL: 'http://wx.mochasoft.com.cn/demo',
	        getTokenURl:'http://wx.mochasoft.com.cn/demo/getTokenURl.json',//像应用中传递token
	        QiXinTodoPushURl:'http://wx.mochasoft.com.cn/demo/QiXinTodoPushURl.json',//主页推送信息

	        getBatchPermissionsURL:'http://wx.mochasoft.com.cn/demo/getBatchPermissions.json',//批量处理权限查询
	        getBatchTodoListURL:'http://wx.mochasoft.com.cn/demo/getBatchTodoList.json',//批处理代办列表
	        getBatchTodoURL:'http://wx.mochasoft.com.cn/demo/getBatchTodo.json',//批处理代办
	        getBatchReadListURL:'http://wx.mochasoft.com.cn/demo/getBatchReadList.json',//批处理代阅列表
	        getBatchReadURL:'http://wx.mochasoft.com.cn/demo/getBatchRead.json',//批处理代阅

	        getWaitTodoURl: 'http://wx.mochasoft.com.cn/demo/getWaitTodoURl.json',//待办列表
	        getOverTodoURl: 'http://wx.mochasoft.com.cn/demo/getOverTodoURl.json',//已办列表
	        getWaitReadURl:'http://wx.mochasoft.com.cn/demo/getWaitReadURl.json',//待阅列表
	        getOverReadURL:'http://wx.mochasoft.com.cn/demo/getOverReadURl.json',//已阅列表
	        getDocumentFileURl: 'http://wx.mochasoft.com.cn/demo/getDocumentFileURl.html',//待办详情-正文
	        getAttachURl: 'http://wx.mochasoft.com.cn/demo/getAttachURl.json',//附件列表
	        getCommonFormURl: 'http://wx.mochasoft.com.cn/demo/getCommonFormURl.json',//基本信息
	        getOpinionURl:'http://wx.mochasoft.com.cn/demo/getOpinionURl.json',//审批意见
	        getFollowFlowURl:'http://wx.mochasoft.com.cn/demo/getFollowFlowURl.json',//流程跟踪
	        getNormalOpinionURl:'http://wx.mochasoft.com.cn/demo/getNormalOpinionURl.json',//获取常用意见
	        getConclusionOpinionURl:'http://wx.mochasoft.com.cn/demo/getConclusionOpinionURl.json',//获取决定意见
	        getNextPathsURl:'http://wx.mochasoft.com.cn/demo/getNextPathsURl.json',//获取提交路径
	        getSaveOpinionURl:'http://wx.mochasoft.com.cn/demo/getSaveOpinionURl.json',//保存意见
	        getBeSaveOpinionURl:'http://wx.mochasoft.com.cn/demo/getExistsOpinionByUserId.json',//获取已保存意见
	        getCandidatesURl:'http://wx.mochasoft.com.cn/demo/getCandidatesURl.json',//获取候选人
	        getSubmitProcessURl:'http://wx.mochasoft.com.cn/demo/getSubmitProcessURl',//提交流程
	        postChangePushURl:'http://wx.mochasoft.com.cn/demo/postChangePushURl.json',//提交后推送
	        getInitDocumentSecretURl:'',//设置密级
	        getExtendURl:''

	    };

	    exports.ajaxConfigExternal = ajaxConfigExternal;
	    exports.ajaxConfigInternal = ajaxConfigInternal;

	}());


/***/ },
/* 18 */
/***/ function(module, exports) {

	/**
	 * Created by lenovo on 2015/12/14.
	 */
	(function () {
	    var punchModel = function () {
	        var self = this;
	        self.questToken = {//定义token请求
	            appName: 'bpm',
	            timestamp: '',
	            nonce: '',
	            login_name: '',
	            mx_sso_token: ''
	        };

	        self.getSignIn = {//上班打卡
	            // userid: 'liwei',
	            // lon: '117.12635',
	            // lat: '39.09037'
	            userid: '',
	            lon: '',
	            lat: ''
	        }

	        self.getSignOut = {//下班打卡
	            // userid: 'liwei',
	            // lon: '117.12635',
	            // lat: '39.09037'
	            userid: '',
	            lon: '',
	            lat: ''
	        }
	        self.updateSignOut = {//下班打卡
	            // userid: 'liwei',
	            // lon: '117.12635',
	            // lat: '39.09037'
	            userid: '',
	            lon: '',
	            lat: '',
	            signType:"pm"
	        }

	        self.getCheckSite = {//检测考勤范围
	            userid: '',
	            lon: '',
	            lat: ''
	            // userid: '',
	            // lon: '',
	            // lat: ''
	        }

	        self.getPunchReport = {//考勤汇总
	            sid: ''
	        };

	        // self.getQuerySign = {//获取用户的打卡记录
	        //     userid: 'haoyao',
	        //     startTime: '2018-12-05',
	        //     endTime: '2018-12-06'
	        // };

	        self.getSiteWorktime = {//获取地市考勤时间配置
	            sid: ''
	        };

	        self.addWhiteList = {//增加白名单人员
	            userId:"",
	            userName:"",
	            siteId:"",
	            uuid:""
	        };

	        self.editWhiteList = {//编辑白名单人员
	            id:'',
	            userId:"",
	            userName:"",
	            siteId:"",
	            uuid:""
	        };
	      self.getSites = {

	        "pageNum":1,
	        "pageSize":10,
	        "sort":{
	          "createAt":"aesc"
	        }
	    }
	      ;

	        self.delWhiteList = {//删除白名单人员
	            id:''
	        };

	        self.getWorkTime = {//获取地市考勤时间配置
	            sid: ''
	        };

	        self.addWorkTime = {//新增地市考勤时间配置
	            siteId:"",
	            signInTime:"",
	            signOutTime:"",
	            signType:""
	        }

	        self.editWorkTime = {//编辑地市考勤时间配置
	            id:"",
	            siteId:"",
	            signInTime:"",
	            signOutTime:"",
	            signType:""
	        }

	        self.delWorkTime = {//删除地市考勤时间配置
	            id:''
	        };
	        self.addSite = {//新增打卡点配置
	            cityId: "",
	            city: "",
	            location: "",
	            lon: 0,
	            lat: 0,
	            distance: 0,
	            signInTime: "",
	            signOutTime: "",
	            remark: ""
	        }

	        self.editSite  = {//新增打卡点配置
	            id:"",
	            cityId: "",
	            city: "",
	            location: "",
	            lon: 0,
	            lat: 0,
	            distance: 0,
	            signInTime: "",
	            signOutTime: "",
	            remark: ""
	        }

	        self.delSite  = {//删除地市考勤时间配置
	            id:''
	        };
	      self.delRecord  = {//删除打卡记录
	        id:''
	      };

	        self.updateRecord = {

	            id:'',
	            inlon:'',
	            inlat:'',
	            outlon:'',
	            outlat:'',
	            inStatus:"",
	            outStatus:"",
	            signInTimeOld:"",
	            signOutTimeOld:"",
	            signInTime:"",
	            signOutTime:"",
	            sign_change:""
	        }
	        self.updateRecordByHid = {
	            hid:'',
	            id:'',
	            inlon:'',
	            inlat:'',
	            outlon:'',
	            outlat:'',
	            inStatus:"",
	            outStatus:"",
	            signInTimeOld:"",
	            signOutTimeOld:"",
	            signInTime:"",
	            signOutTime:"",
	            sign_change:""
	        }
	        self.insertRecord = {
	            userId:"",
	            siteId:"",
	            signType:"",
	            inlon:'',
	            inlat:'',
	            outlon:'',
	            outlat:'',
	            inStatus:"",
	            outStatus:"",
	            signInTime:"",
	            signOutTime:"",
	            uuid:""
	        }
	        self.getUUID = {
	            loginName:""
	        }

	    };
	    exports.punchModel = new punchModel();
	}());


/***/ },
/* 19 */
/***/ function(module, exports, __webpack_require__) {

	(function () {
	    var business_PUNCH = __webpack_require__(16).business_PUNCH;
	    var punch_model = __webpack_require__(18).punchModel;
	    var ajaxConfig = __webpack_require__(17).ajaxConfigExternal;
	    punch_model = Object.create(punch_model);
	    angular.module('formlyObj.controllers').controller('PunchWhitelistCtrl', ['$scope','$rootScope', '$timeout', '$location', '$sce', 'GlobalStorageService','toaster'
	        , function PunchWhitelistCtrl($scope,$rootScope, $timeout, $location, $sce, GlobalStorageService,toaster) {
	            var vm = this;

	            $scope.index=9;

	            function findSiteMsg(id){
	                for(var m=0;m<$scope.site.length;m++){
	                    var msg={};
	                    if($scope.site[m].id===id){
	                        msg=$scope.site[m];
	                    }
	                    console.log($scope.site[m])
	                    break;
	                }
	                return msg;
	            }

	            //获取白名单列表
	            $scope.getWhiteList = function () {
	                business_PUNCH.getWhiteList().then(
	                    function (req) {
	                        if (req.status === '1') {
	                            for(var i=0;i<req.data.length;i++){
	                                var siteid=req.data[i].siteId;
	                                req.data[i].siteMsg= findSiteMsg(siteid)
	                            }
	                            $scope.whitelist=req.data;
	                            $scope.$apply();
	                            console.log($scope.whitelist);
	                        }else{
	                            toaster.pop('info', "", "数据请求失败");
	                        }


	                    }, function (ret) {
	                        $scope.ShowLoading=false;
	                        console.log(ret);
	                        toaster.pop('info', "", "网络请求失败");
	                    }
	                );

	            }

	            //获取打卡点列表
	            $scope.getSite = function () {
	                var queryJson={
	                    pageNum:1,
	                    pageSize: 99999,
	                    sort:{
	                        "createAt":"aesc"
	                    }
	                };
	                business_PUNCH.getSites(queryJson).then(
	                    function (req) {
	                        console.log(req);
	                        if (req.status === '1') {
	                            $scope.site=req.data.siteList;
	                            GlobalStorageService.setSiteList( $scope.site);
	                            $scope.getWhiteList();
	                        }else{
	                            toaster.pop('info', "", "数据请求失败");
	                        }


	                    }, function (ret) {
	                        $scope.ShowLoading=false;
	                        console.log(ret);
	                        toaster.pop('info', "", "网络请求失败");
	                    }
	                );

	            }
	            $scope.getSite();
	          /*  $scope.initd = function (){
	                $.ajax({
	                    url:ajaxConfig.BASE_URL+ajaxConfig.LoginUrl+"?username=admin&password=admin123",
	                    type: "GET",
	                    // type: "POST",
	                    // data: JSON.stringify(punch_model.getSignIn),
	                    // contentType: 'application/json',
	                    //rocessData: false,  // 告诉jQuery不要去处理发送的数据
	                    //contentType: 'application/x-www-form-urlencoded',   // 告诉jQuery不要去设置Content-Type请求头
	                    success: function(req){
	                        console.log(req.data);
	                       // $scope.getDeptList = req.data;
	                        if(req.status === "1"){
	                            $scope.getWhiteList()


	                        }else if(req.status === "0"){

	                        }

	                    },error:function (ret) {
	                        console.log(ret);
	                    }
	                });
	            }

	            $scope.initd();*/
	            /*//一级下拉切换
	            $scope.changeFirst = function(){
	                console.log("$scope.ps.first",$scope.ps.first);
	                var parentId = $scope.ps.first;
	                $scope.ps.firstname = $("#firstq").find("option:selected").text();
	                console.log("$scope.ps.firstname",$scope.ps.firstname);

	                //获取部门列表
	                $.ajax({
	                    url:ajaxConfig.BASE_URL+ajaxConfig.getDeptListUrl+"?parentId="+parentId,
	                    type: "GET",
	                    //rocessData: false,  // 告诉jQuery不要去处理发送的数据
	                    //contentType: 'application/x-www-form-urlencoded',   // 告诉jQuery不要去设置Content-Type请求头
	                    success: function(req){
	                        $scope.getSubDeptList = req.data;
	                        console.log($scope.getSubDeptList);

	                        var normal={

	                            id:0,
	                            short_name :"请选择部门"
	                        };

	                        if(req.data.length>0 && $scope.ps.first!=0){

	                            $scope.getSubDeptList.splice(0,0,normal);

	                            vm.levelTwo = $scope.getSubDeptList;
	                            $scope.ps.second = $scope.getSubDeptList[0].id;
	                            $scope.ps.secondname = $scope.getSubDeptList[0].short_name;
	                            $scope.$apply();

	                        }else if($scope.ps.first==0){

	                        }

	                    },error:function (ret) {
	                        console.log(ret);
	                    }
	                });

	            }

	            //二级下拉切换
	            $scope.changeSecond = function () {
	                vm.pageNum = 1;
	                $scope.ps.secondname=$("#secondq").find("option:selected").text();
	                console.log($scope.ps.second);
	                console.log($scope.getSubDeptList);

	                $scope.subDeptArr = [];
	                for(var i=0;i<$scope.getSubDeptList.length;i++){
	                    $scope.subDeptArr.push($scope.getSubDeptList[i].id);
	                }
	                console.log($scope.subDeptArr);
	                //$scope.subDeptArr = [1563, 1565, 1566, 1567, 1568, 1574, 1575, 1576, 1577, 1578, 1581, 1558, 1559, 2267, 1560, 1561, 2374, 1562, 1564, 2266, 2324, 1582, 1569, 1570, 1571, 1572, 1573, 2592, 2439, 1580, 1579];
	                //$scope.test = 1615;
	                var deptCodeIdx = $scope.subDeptArr.indexOf(parseInt($scope.ps.second));
	                console.log(typeof ($scope.ps.second));
	                console.log(parseInt($scope.ps.second));
	                console.log(deptCodeIdx);
	                if(deptCodeIdx === -1){
	                    //alert("请选择分公司");
	                    var dialogIns;
	                    $scope.dialogText="请选择分公司";
	                    function initDialog(){
	                        $(function(){
	                            dialogIns=  $('#ConfirmMsg').dialog({
	                                autoOpen: false,
	                                width: 300,
	                                modal: true,
	                                position:{ using:function(pos){
	                                    console.log(pos)
	                                    var topOffset = $(this).css(pos).offset().top;
	                                    if (topOffset = 0||topOffset>0) {
	                                        $(this).css('top', 150);
	                                    }
	                                }},
	                                buttons: {
	                                    // "我再想想": function() {
	                                    //     $(this).dialog('close');
	                                    //     $scope.dialogText="";
	                                    // },
	                                    "确认": function() {
	                                        //mDialogCallback(false);
	                                        //$scope.delsurvey( $scope.delitem);
	                                        $(this).dialog('close');
	                                        $scope.dialogText="请选择分公司";
	                                    }
	                                }
	                            });
	                        })
	                    }
	                    $scope.dialogText="请选择分公司";
	                    initDialog();
	                    //  $('#ConfirmMsgBody').html(message);
	                    dialogIns.dialog('open');
	                }else{
	                    $scope.dept_code = $scope.getSubDeptList[deptCodeIdx].dept_code;
	                }

	            }*/

	            $scope.editWhite = function (item) {
	               GlobalStorageService.setWhiteUser(item);
	                GlobalStorageService.setIndex(9);
	                $location.path("/punch-addPerson");
	              //  $scope.$apply();
	            };
	            $scope.addWhite = function () {
	                GlobalStorageService.setWhiteUser({});
	                GlobalStorageService.setIndex(9);
	                $location.path("/punch-addPerson");
	               // $scope.$apply();

	            };
	            $scope.goback = function () {
	               history.go(-1);
	                // $scope.$apply();

	            };
	            //table点击折行
	            $scope.firstFloor = function (index,userid,item) {
	                //table折叠加减号切换
	                item.isHover = !item.isHover;
	                console.log(!item.isHover);

	                console.log(index);
	                console.log(userid);

	                if($scope.adminQuery[index].show){
	                    $scope.adminQuery[index].show=false;
	                }else if(!$scope.adminQuery[index].show){
	                    $scope.adminQuery[index].show=true;
	                }

	            }


	            $scope.delConfirm = function (message, item) {
	                var dialogIns;
	                function initDialog(){
	                    $(function(){

	                        dialogIns=  $(".ConfirmMsgDel").dialog({
	                            autoOpen: false,
	                            width: 300,
	                            modal: true,
	                            position:{ using:function(pos){
	                                console.log(pos)
	                                var topOffset = $(this).css(pos).offset().top;
	                                if (topOffset = 0||topOffset>0) {
	                                    $(this).css('top', 150);
	                                }
	                            }},
	                            buttons: {
	                                "我再想想": function() {
	                                    $(this).dialog('close');
	                                   // $scope.dialogText="";
	                                },
	                                "确认": function() {
	                                    //mDialogCallback(false);
	                                    $scope.delWhitePerson( $scope.delitem);
	                                    $(this).dialog('close');
	                                  //  $scope.dialogText="";
	                                }
	                            }
	                        });
	                    })
	                }

	               // $scope.dialogText="确认删除该问卷么？";
	                initDialog();

	                $scope.delitem=item;
	                dialogIns.dialog('open');

	                //  $('#ConfirmMsgBody').html(message);

	            };
	            $scope.delWhitePerson = function (item) {
	                punch_model.delWhiteList.id = item.id;
	                $scope.ShowLoading=true;
	                business_PUNCH.delWhiteList(punch_model.delWhiteList).then(
	                    function (req) {
	                        $scope.ShowLoading=false;
	                        if (req.status == '1') {//缺一个确认
	                            toaster.pop('info', "", "删除成功");
	                            $scope.getWhiteList();

	                        } else {
	                            toaster.pop('info', "", "获取数据失败");
	                            if(req.message=='not login admin'){
	                                alert('您没有管理员权限，请先登录');
	                                $location.path("/loginAdmin");
	                            }

	                        }

	                    }, function (ret) {
	                        $scope.ShowLoading=false;
	                        console.log(ret);
	                        toaster.pop('info', "", "网络请求失败");
	                    }
	                );
	            };
	          /*  //获取ipt时间
	            $scope.punchStartDate = $("#punchDetailStartIpt").val();
	            $scope.punchEndDate = $("#punchDetailEndIpt").val();*/

	           /* //日期范围判断
	            $scope.adminQueryBtn = function () {
	                var d1 = new Date($scope.punchStartDate.replace(/\-/g, "\/"));
	                var d2 = new Date($scope.punchEndDate.replace(/\-/g, "\/"));
	                if($scope.punchStartDate!=""&&$scope.punchEndDate!=""&&d1 >=d2){
	                    //alert("开始时间不能大于结束时间！");

	                    var dialogIns;
	                    function initDialog(){
	                        $(function(){
	                            dialogIns=  $('#ConfirmMsg').dialog({
	                                autoOpen: false,
	                                width: 300,
	                                modal: true,
	                                position:{ using:function(pos){
	                                    console.log(pos)
	                                    var topOffset = $(this).css(pos).offset().top;
	                                    if (topOffset = 0||topOffset>0) {
	                                        $(this).css('top', 150);
	                                    }
	                                }},
	                                buttons: {
	                                    // "我再想想": function() {
	                                    //     $(this).dialog('close');
	                                    //     $scope.dialogText="";
	                                    // },
	                                    "确认": function() {
	                                        //mDialogCallback(false);
	                                        //$scope.delsurvey( $scope.delitem);
	                                        $(this).dialog('close');
	                                        $scope.dialogText="";
	                                    }
	                                }
	                            });
	                        })
	                    }
	                    $scope.dialogText="开始时间不能大于或等于结束时间";
	                    initDialog();
	                    //  $('#ConfirmMsgBody').html(message);
	                    dialogIns.dialog('open');

	                    return false;
	                }
	                $scope.getAdminQuery();
	            }
	*/
	            //$scope.devinfoName = "";

	            // $scope.myKeyup = function () {
	            //     console.log($scope.devinfoName);
	            //     $scope.getAdminQuery();
	            // }


	        /*    $scope.searchName = function(){
	                $scope.getAdminQuery();
	                console.log($scope.adminQuery);
	            }

	            // 导出生成csv文件
	            $scope.exportCsv = function(){
	                //var s='uFEFF'
	                var s = '';
	                s +='部门,人员,账号,电话,邮箱,规定上午上班打卡时间,上午上班打卡时间,上午上班打卡状态,规定上午下班打卡时间,上午下班打卡时间,上午下班打卡状态,规定下午上班打卡时间,下午上班打卡时间,下午上班打卡状态,规定下午下班打卡时间,下午下班打卡时间,下午下班打卡状态\n';
	                $scope.getAdminQuery();
	                for(var i=0;i<$scope.adminQuery.length;i++){
	                    $scope.deptName = $scope.adminQuery[i].deptName;
	                    $scope.username = $scope.adminQuery[i].username;
	                    $scope.userid = $scope.adminQuery[i].userid;
	                    $scope.tel = $scope.adminQuery[i].tel;
	                    $scope.email = $scope.adminQuery[i].email;
	                    $scope.amFixInTime = $scope.adminQuery[i].amFixInTime;
	                    $scope.amSignInTime = $scope.adminQuery[i].amSignInTime;
	                    $scope.amSignInStatus = $scope.adminQuery[i].amSignInStatus;
	                    $scope.amFixOutTime = $scope.adminQuery[i].amFixOutTime;
	                    $scope.amSignOutTime = $scope.adminQuery[i].amSignOutTime;
	                    $scope.amSignOutStatus = $scope.adminQuery[i].amSignOutStatus;
	                    $scope.pmFixInTime = $scope.adminQuery[i].pmFixInTime;
	                    $scope.pmSignInTime = $scope.adminQuery[i].pmSignInTime;
	                    $scope.pmSignInStatus = $scope.adminQuery[i].pmSignInStatus;
	                    $scope.pmFixOutTime = $scope.adminQuery[i].pmFixOutTime;
	                    $scope.pmSignOutTime = $scope.adminQuery[i].pmSignOutTime;
	                    $scope.pmSignOutStatus = $scope.adminQuery[i].pmSignOutStatus;
	                    s += $scope.deptName+','+$scope.username+','+$scope.userid+','+$scope.tel+','+$scope.email+','+$scope.amFixInTime+','+$scope.amSignInTime+','+$scope.amSignInStatus+','+$scope.amFixOutTime+','+$scope.amSignOutTime+','+$scope.amSignOutStatus +','+$scope.pmFixInTime+','+$scope.pmSignInTime+','+$scope.pmSignInStatus+','+$scope.pmFixOutTime+','+$scope.pmSignOutTime+','+$scope.pmSignOutStatus+'\n';
	                }
	                //var blob = new Blob([s], { type: "text/plain;charset=gbk" });
	                var blob = new Blob([s], { type: "text/plain;charset=utf-8" });
	                //saveAs(blob, "test.csv");
	                saveAs(blob,'考勤打卡-打卡明细-'+$scope.punchStartDate+'--'+$scope.punchEndDate+'.csv');
	            }*/


	     }]);

	}());


/***/ },
/* 20 */
/***/ function(module, exports, __webpack_require__) {

	(function () {
	    var business_PUNCH = __webpack_require__(16).business_PUNCH;
	    var punch_model = __webpack_require__(18).punchModel;
	    var ajaxConfig = __webpack_require__(17).ajaxConfigExternal;
	    punch_model = Object.create(punch_model);
	    angular.module('formlyObj.controllers').controller('PunchAddPersonCtrl', ['$scope', '$timeout', '$location', 'constantData', 'GlobalStorageService','toaster'
	        , function PunchAddPersonCtrl($scope, $timeout, $location, constantData, GlobalStorageService,toaster) {
	            var self = this;
	            $scope.userInfo={

	                userid: "",
	                username: "",
	                siteid: "-1",
	                uuid: ""
	            }
	            $scope.siteList=GlobalStorageService.getSiteList();
	            console.log(   $scope.siteList);
	            $scope.userInfo=GlobalStorageService.getWhiteUser();
	            console.log(  $scope.userInfo);
	            if(!$scope.userInfo.id){
	                $scope.whiteType=0;
	            }else{
	                $scope.whiteType=1;
	            }

	            $scope.goBack = function () {
	                history.go(-1);
	            };

	            $scope.addPerson = function () {
	                if($scope.userInfo.userid===''){
	                    toaster.pop('info', "", "请输入用户id");
	                }else if($scope.userInfo.username===''){
	                    toaster.pop('info', "", "请输入用户名");
	                }else if($scope.userInfo.siteId===''){
	                    toaster.pop('info', "", "请选择打卡点");
	                }else{
	                    punch_model.addWhiteList.userId=$scope.userInfo.userId;
	                    punch_model.addWhiteList.userName=$scope.userInfo.userName;
	                    punch_model.addWhiteList.siteId=$scope.userInfo.siteId;
	                    punch_model.addWhiteList.uuid=$scope.userInfo.uuid;

	                    business_PUNCH.addWhiteList(JSON.stringify(punch_model.addWhiteList)).then(
	                        function (req) {
	                            console.log(req);
	                            if (req.status === '1') {
	                                toaster.pop('info', "", "添加成功");
	                                history.go(-1);
	                            }else{
	                                toaster.pop('info', "", "数据请求失败");
	                            }


	                        }, function (ret) {
	                            $scope.ShowLoading=false;
	                            console.log(ret);
	                            toaster.pop('info', "", "网络请求失败");
	                        }
	                    );
	                }



	            };

	            $scope.editPerson = function () {
	                if($scope.userInfo.userid===''){
	                    toaster.pop('info', "", "请输入用户id");
	                }else if($scope.userInfo.username===''){
	                    toaster.pop('info', "", "请输入用户名");
	                }else if($scope.userInfo.siteid===''){
	                    toaster.pop('info', "", "请选择打卡点");
	                }else{
	                    punch_model.editWhiteList.userId=$scope.userInfo.userId;
	                    punch_model.editWhiteList.userName=$scope.userInfo.userName;
	                    punch_model.editWhiteList.siteId=$scope.userInfo.siteId;
	                    punch_model.editWhiteList.uuid=$scope.userInfo.uuid;
	                    punch_model.editWhiteList.id=$scope.userInfo.id;

	                    business_PUNCH.editWhiteList(JSON.stringify(punch_model.editWhiteList)).then(
	                        function (req) {
	                            console.log(req);
	                            if (req.status === '1') {
	                                toaster.pop('info', "", "修改成功");
	                                history.go(-1);
	                            }else{
	                                toaster.pop('info', "", "数据请求失败");
	                            }


	                        }, function (ret) {
	                            $scope.ShowLoading=false;
	                            console.log(ret);
	                            toaster.pop('info', "", "网络请求失败");
	                        }
	                    );
	                }


	            };

	        }]);

	}());


/***/ },
/* 21 */
/***/ function(module, exports, __webpack_require__) {

	(function () {
	    var business_PUNCH = __webpack_require__(16).business_PUNCH;
	    var punch_model = __webpack_require__(18).punchModel;
	    var ajaxConfig = __webpack_require__(17).ajaxConfigExternal;
	    punch_model = Object.create(punch_model);
	    angular.module('formlyObj.controllers').controller('PunchSitelistCtrl', ['$scope','$rootScope', '$timeout', '$location', '$sce', 'GlobalStorageService','toaster'
	        , function PunchSitelistCtrl($scope,$rootScope, $timeout, $location, $sce, GlobalStorageService,toaster) {
	            var vm = this;
	        $scope.ps={
	          city:"",//地市名称
	          location:""//打卡点名称
	        };
	        $scope.index=9;

	            function findSiteMsg(id){
	                for(var m=0;m<$scope.site.length;m++){
	                    var msg={};
	                    if($scope.site[m].id===id){
	                        msg=$scope.site[m];
	                    }
	                    console.log($scope.site[m])
	                    break;
	                }
	                return msg;
	            }

	        vm.pageNum=1;
	        vm.pageSize=10;
	        vm.totalPages = "";
	        // vm.hasLeft=false;
	        // vm.hasRight=false;
	        vm.hasLeft=true;
	        vm.hasRight=true;
	            var init=0;
	            //获取打卡点列表
	            $scope.getSite = function (pages,content) {
	                console.log(pages);
	                if(!pages){
	                    pages=1;
	                }

	              var queryJson={
	                pageNum:pages,
	                city:$scope.ps.city,
	                location:$scope.ps.location,
	                pageSize: punch_model.getSites.pageSize,
	                sort:{
	                  "createAt":"aesc"
	                }
	              };
	              if($scope.ps.city&&$scope.ps.city!==""){
	                queryJson.city=$scope.ps.city;
	              }
	              if($scope.ps.location&&$scope.ps.location!==""){
	                queryJson.location=$scope.ps.location;
	              }
	                business_PUNCH.getSites(queryJson).then(
	                    function (req) {
	                        console.log(req);
	                        if (req.status === '1') {
	                            $scope.site=req.data.siteList;

	                          vm.sum = req.data.sum;

	                          //总页数
	                          vm.totalPages = Math.ceil(vm.sum/   punch_model.getSites.pageSize);
	                          console.log("totalPages",vm.totalPages);

	                          vm.nowPage = vm.pageNum;
	                          vm.pageList = [];
	                          console.log(vm.nowPage);


	                          if(vm.nowPage <= 3 || vm.sum <= punch_model.getSites.pageSize){
	                            for(var i = 1; i<=vm.totalPages && i<= 10;i++){
	                              vm.pageList.push(i);
	                              console.log("pagelist",vm.pageList);
	                            }

	                            if(5<vm.sum){
	                              vm.hasRight=true;
	                            }

	                          }else{
	                            for(var i = vm.nowPage-2;i <= vm.totalPages && i <= vm.nowPage+2;i++){
	                              vm.pageList.push(i);
	                              console.log("pagelist2",vm.pageList);
	                            }

	                            if(vm.nowPage-2>1){
	                              vm.hasLeft=true;
	                            }
	                            if(vm.nowPage+2<vm.sum){
	                              vm.hasRight=true;
	                            }

	                          }

	                            $scope.$apply();
	                        }else{
	                            toaster.pop('info', "", "数据请求失败");
	                        }


	                    }, function (ret) {
	                        $scope.ShowLoading=false;
	                        console.log(ret);
	                        toaster.pop('info', "", "网络请求失败");
	                    }
	                );

	            }
	            $scope.getSite(1,"");

	        //分页
	        vm.jumpPage = function (pageNum) {
	          console.log(pageNum);
	          vm.pageNum = pageNum;
	          $scope.getSite(vm.pageNum,null);
	        };

	        vm.toPage = function(nowPage,type){
	          console.log('nowPage',nowPage);
	          console.log('type',type);
	          if(type === "last"){
	            if(nowPage === 1){

	            }else{
	              vm.pageNum = 1;
	              $scope.getSite(vm.pageNum,null);
	            }
	          }else{
	            console.log("type",type);
	            console.log("totalPages",vm.totalPages);
	            vm.pageNum = vm.totalPages;
	            $scope.getSite(vm.pageNum,null);

	          }
	        }

	            $scope.editSite = function (item) {
	          console.log(item);
	                var site=item;
	                var siteId=item.id;
	                punch_model.getWorkTime.sid=siteId;
	                business_PUNCH.getWorkTime(punch_model.getWorkTime).then(
	                    function (req) {
	                        console.log(req);
	                        if (req.status === '1') {
	                            var sitetime = req.data;
	                            for(var i=0;i<sitetime.length;i++){
	                                if(sitetime[i].signType==='am'){
	                                    site.amId=(sitetime[i].id);
	                                    site.signInTimeAM=(sitetime[i].signInTime);
	                                    site.signOutTimeAM=(sitetime[i].signOutTime);
	                                }else{
	                                    site.pmId=(sitetime[i].id);
	                                    site.signInTimePM=(sitetime[i].signInTime);
	                                    site.signOutTimePM=(sitetime[i].signOutTime);

	                                }
	                            }
	                            console.log(site)
	                            GlobalStorageService.setSite(site);
	                            $location.path("/punch-addSite");
	                            $scope.$apply();
	                            /*
	                            GlobalStorageService.setIndex(9);
	                            $location.path("/punch-addSite");
	                            $scope.$apply();*/
	                        }else{
	                            toaster.pop('info', "", "数据请求失败");
	                        }


	                    }, function (ret) {
	                        $scope.ShowLoading=false;
	                        console.log(ret);
	                        toaster.pop('info', "", "网络请求失败");
	                    }
	                );

	            };
	            $scope.addSite = function () {
	                GlobalStorageService.setSite({
	                    cityId: "",
	                    city: "",
	                    location: "",
	                    lon: 0,
	                    lat: 0,
	                    distance: 0,
	                    amId: "",
	                    pmId: "",
	                    signInTimeAM: "",
	                    signOutTimeAM: "",
	                    signInTimAM: "",
	                    signOutTimePM: "",
	                    remark: ""
	                });

	                $location.path("/punch-addSite");


	            };
	            $scope.goback = function () {
	               history.go(-1);
	                // $scope.$apply();

	            };



	            $scope.delConfirm = function (message, item) {
	                var dialogIns;
	                function initDialog(){
	                    $(function(){

	                        dialogIns=  $(".ConfirmMsgDelSite").dialog({
	                            autoOpen: false,
	                            width: 300,
	                            modal: true,
	                            position:{ using:function(pos){
	                                console.log(pos)
	                                var topOffset = $(this).css(pos).offset().top;
	                                if (topOffset = 0||topOffset>0) {
	                                    $(this).css('top', 150);
	                                }
	                            }},
	                            buttons: {
	                                "我再想想": function() {
	                                    $(this).dialog('close');
	                                   // $scope.dialogText="";
	                                },
	                                "确认": function() {
	                                    //mDialogCallback(false);
	                                    $scope.delSite( $scope.delitem);
	                                    $(this).dialog('close');
	                                  //  $scope.dialogText="";
	                                }
	                            }
	                        });
	                    })
	                }
	                $scope.delitem=item;
	               // $scope.dialogText="确认删除该问卷么？";
	                initDialog();


	                dialogIns.dialog('open');

	                //  $('#ConfirmMsgBody').html(message);

	            };
	            $scope.delSite = function (item) {
	                punch_model.delSite.id = item.id;
	                $scope.ShowLoading=true;
	                business_PUNCH.delSite(punch_model.delSite).then(
	                    function (req) {
	                        $scope.ShowLoading=false;
	                        if (req.status === '1') {//缺一个确认
	                            toaster.pop('info', "", "删除成功");
	                            $scope.getSite();

	                        } else {
	                            toaster.pop('info', "", "获取数据失败");
	                            if(req.message=='not login admin'){
	                                alert('您没有管理员权限，请先登录');
	                                $location.path("/loginAdmin");
	                            }

	                        }

	                    }, function (ret) {
	                        $scope.ShowLoading=false;
	                        console.log(ret);
	                        toaster.pop('info', "", "网络请求失败");
	                    }
	                );
	            };



	     }]);

	}());


/***/ },
/* 22 */
/***/ function(module, exports, __webpack_require__) {

	(function () {
	    var business_PUNCH = __webpack_require__(16).business_PUNCH;
	    var punch_model = __webpack_require__(18).punchModel;
	    var ajaxConfig = __webpack_require__(17).ajaxConfigExternal;
	    punch_model = Object.create(punch_model);
	    angular.module('formlyObj.controllers').controller('PunchAddSiteCtrl', ['$scope', '$timeout', '$location', 'constantData', 'GlobalStorageService','toaster'
	        , function PunchAddSiteCtrl($scope, $timeout, $location, constantData, GlobalStorageService,toaster) {
	            var self = this;
	            $scope.Site={
	                cityId: "",
	                city: "",
	                location: "",
	                lon: 0,
	                lat: 0,
	                distance: 0,
	                amId: "",
	                pmId: "",
	                signInTimeAM: "",
	                signOutTimeAM: "",
	                signInTimAM: "",
	                signOutTimePM: "",
	                remark: ""
	            };
	            $scope.deptCodeTreeShow =false;
	            $scope.Site=GlobalStorageService.getSite();

	            if(!$scope.Site.id){
	                $scope.whiteType=0;
	            }else{
	                $scope.whiteType=1;
	            }

	            $scope.goBack = function () {
	                history.go(-1);
	            };
	            $scope.showTree = function () {
	                $scope.deptCodeTreeShow =!$scope.deptCodeTreeShow;
	            };

	            $scope.addSite = function () {
	                if($scope.Site.cityId===''){
	                    toaster.pop('info', "", "请输入地址编号");
	                }else if($scope.Site.city===''){
	                    toaster.pop('info', "", "请输入地市名称");
	                }else if($scope.Site.location===''){
	                    toaster.pop('info', "", "请输入打卡点名称");
	                }else if($scope.Site.lon===''){
	                    toaster.pop('info', "", "请输入经度");
	                }else if($scope.Site.lat===''){
	                    toaster.pop('info', "", "请输入纬度");
	                }else if($scope.Site.distance===''){
	                    toaster.pop('info', "", "请输入考勤范围");
	                }else if($scope.Site.signInTimeAM===''){
	                    toaster.pop('info', "", "请输入上午签到时间");
	                }else if($scope.Site.signInTimePM===''){
	                    toaster.pop('info', "", "请输入上午签退时间");
	                }else if($scope.Site.signOutTimeAM===''){
	                    toaster.pop('info', "", "请输入下午签到时间");
	                }else if($scope.Site.signOutTimePM===''){
	                    toaster.pop('info', "", "请输入下午签退时间");
	                }else{
	                    punch_model.addSite.cityId=$scope.Site.cityId;
	                    punch_model.addSite.city=$scope.Site.city;
	                    punch_model.addSite.location=$scope.Site.location;
	                    punch_model.addSite.lon=$scope.Site.lon;
	                    punch_model.addSite.lat=$scope.Site.lat;
	                    punch_model.addSite.distance=$scope.Site.distance;
	                    punch_model.addSite.signInTime=$scope.Site.signInTimeAM;
	                    punch_model.addSite.signOutTime=$scope.Site.signOutTimePM;
	                    punch_model.addSite.remark=$scope.Site.remark;
	                    punch_model.addSite.type="default";

	                    business_PUNCH.addSite(JSON.stringify(punch_model.addSite)).then(
	                        function (req) {
	                            console.log(req);
	                            if (req.status === '1') {
	                                toaster.pop('info', "", "添加成功");
	                                var queryJson={
	                                    pageNum:1,
	                                    city:"",
	                                    location:$scope.Site.location,
	                                    pageSize: 99999,
	                                    sort:{
	                                        "createAt":"aesc"
	                                    }
	                                };
	                                business_PUNCH.getSites(queryJson).then(
	                                    function (req) {
	                                        console.log(req);
	                                        if (req.status === '1') {
	                                            $scope.siteL=req.data.siteList;
	                                            for(var i=0;i<$scope.siteL.length;i++){
	                                                if($scope.siteL[i].location===$scope.Site.location&&$scope.siteL[i].cityId===$scope.Site.cityId){
	                                                    punch_model.addWorkTime.siteId=$scope.siteL[i].id;
	                                                    punch_model.addWorkTime.signInTime=$scope.Site.signInTimeAM;
	                                                    punch_model.addWorkTime.signOutTime=$scope.Site.signOutTimeAM;
	                                                    punch_model.addWorkTime.signType='am';
	                                                    business_PUNCH.addWorkTime(JSON.stringify(punch_model.addWorkTime)).then(
	                                                        function (req) {
	                                                            console.log(req);
	                                                            if (req.status === '1') {
	                                                                toaster.pop('info', "", "添加成功");
	                                                                punch_model.addWorkTime.siteId=$scope.siteL[i].id;
	                                                                punch_model.addWorkTime.signInTime=$scope.Site.signInTimePM;
	                                                                punch_model.addWorkTime.signOutTime=$scope.Site.signOutTimePM;
	                                                                punch_model.addWorkTime.signType='pm';
	                                                                business_PUNCH.addWorkTime(JSON.stringify(punch_model.addWorkTime)).then(
	                                                                    function (req) {
	                                                                        console.log(req);
	                                                                        if (req.status === '1') {
	                                                                            toaster.pop('info', "", "添加成功");
	                                                                            history.go(-1);
	                                                                        }else{
	                                                                            toaster.pop('info', "", "数据请求失败");
	                                                                        }


	                                                                    }, function (ret) {
	                                                                        $scope.ShowLoading=false;
	                                                                        console.log(ret);
	                                                                        toaster.pop('info', "", "网络请求失败");
	                                                                    }
	                                                                );
	                                                            }else{
	                                                                toaster.pop('info', "", "数据请求失败");
	                                                            }


	                                                        }, function (ret) {
	                                                            $scope.ShowLoading=false;
	                                                            console.log(ret);
	                                                            toaster.pop('info', "", "网络请求失败");
	                                                        }
	                                                    );
	                                                    break;
	                                                }
	                                            }


	                                        }else{
	                                            toaster.pop('info', "", "数据请求失败");
	                                        }


	                                    }, function (ret) {
	                                        $scope.ShowLoading=false;
	                                        console.log(ret);
	                                        toaster.pop('info', "", "网络请求失败");
	                                    }
	                                );



	                            }else{
	                                toaster.pop('info', "", "数据请求失败");
	                            }


	                        }, function (ret) {
	                            $scope.ShowLoading=false;
	                            console.log(ret);
	                            toaster.pop('info', "", "网络请求失败");
	                        }
	                    );
	                }



	            };

	            var check=new RegExp(/^[1-9][0-9]*([.][0-9]+)?$/);

	            $scope.editSite = function () {
	                console.log($scope.Site.signInTimeAM);
	                console.log($scope.Site.signInTimePM);
	                if($scope.Site.cityId===''){
	                    toaster.pop('info', "", "请输入地址编号");
	                }else if($scope.Site.city===''){
	                    toaster.pop('info', "", "请输入地市名称");
	                }else if($scope.Site.location===''){
	                    toaster.pop('info', "", "请输入打卡点名称");
	                }else if($scope.Site.lon===''||!check.test($scope.Site.lon)){
	                    //console.log($scope.Site.lon)
	                    //console.log(check.test($scope.Site.lon))
	                    toaster.pop('info', "", "请输入经度");
	                }else if($scope.Site.lat===''||!check.test($scope.Site.lat)){
	                    //console.log($scope.Site.lat)
	                    //console.log(check.test($scope.Site.lat))
	                    toaster.pop('info', "", "请输入纬度");
	                }else if($scope.Site.distance===''||!check.test($scope.Site.distance)){
	                    toaster.pop('info', "", "请输入考勤范围");
	                }else if($scope.Site.signInTimeAM&&$scope.Site.signInTimeAM===''){
	                    toaster.pop('info', "", "请输入上午签到时间");
	                }else if($scope.Site.signInTimePM&&$scope.Site.signInTimePM===''){
	                    toaster.pop('info', "", "请输入上午签退时间");
	                }else if($scope.Site.signOutTimeAM&&$scope.Site.signOutTimeAM===''){
	                    toaster.pop('info', "", "请输入下午签到时间");
	                }else if($scope.Site.signOutTimePM&&$scope.Site.signOutTimePM===''){
	                    toaster.pop('info', "", "请输入下午签退时间");
	                }else{
	                    punch_model.editSite.id=$scope.Site.id;
	                    punch_model.editSite.cityId=$scope.Site.cityId;
	                    punch_model.editSite.city=$scope.Site.city;
	                    punch_model.editSite.location=$scope.Site.location;
	                    punch_model.editSite.lon=$scope.Site.lon;
	                    punch_model.editSite.lat=$scope.Site.lat;
	                    punch_model.editSite.distance=$scope.Site.distance;
	                    punch_model.editSite.city=$scope.Site.city;
	                    punch_model.editSite.signInTime=$scope.Site.signInTimeAM;
	                    punch_model.editSite.signOutTime=$scope.Site.signOutTimePM;
	                    punch_model.editSite.remark=$scope.Site.remark;
	                    punch_model.editSite.type="default";

	                    business_PUNCH.editSite(JSON.stringify(punch_model.editSite)).then(
	                        function (req) {
	                            console.log(req);
	                            if (req.status === '1') {
	                                toaster.pop('info', "", "修改成功");

	                                punch_model.editWorkTime.id=$scope.Site.amId;
	                                punch_model.editWorkTime.siteId=$scope.Site.id;
	                                punch_model.editWorkTime.signInTime=$scope.Site.signInTimeAM;
	                                punch_model.editWorkTime.signOutTime=$scope.Site.signOutTimeAM;
	                                punch_model.editWorkTime.signType='am';
	                                business_PUNCH.updateWorkTime(JSON.stringify(punch_model.editWorkTime)).then(
	                                    function (req) {
	                                        console.log(req);
	                                        if (req.status === '1') {
	                                            toaster.pop('info', "", "修改成功");
	                                            punch_model.editWorkTime.id=$scope.Site.pmId;
	                                            punch_model.editWorkTime.siteId=$scope.Site.id;
	                                            punch_model.editWorkTime.signInTime=$scope.Site.signInTimePM;
	                                            punch_model.editWorkTime.signOutTime=$scope.Site.signOutTimePM;
	                                            punch_model.editWorkTime.signType='pm';
	                                            business_PUNCH.updateWorkTime(JSON.stringify(punch_model.editWorkTime)).then(
	                                                function (req) {
	                                                    console.log(req);
	                                                    if (req.status === '1') {
	                                                        toaster.pop('info', "", "修改成功");
	                                                        history.go(-1);
	                                                    }else{
	                                                        toaster.pop('info', "", "数据请求失败");
	                                                    }


	                                                }, function (ret) {
	                                                    $scope.ShowLoading=false;
	                                                    console.log(ret);
	                                                    toaster.pop('info', "", "网络请求失败");
	                                                }
	                                            );
	                                        }else{
	                                            toaster.pop('info', "", "数据请求失败");
	                                        }


	                                    }, function (ret) {
	                                        $scope.ShowLoading=false;
	                                        console.log(ret);
	                                        toaster.pop('info', "", "网络请求失败");
	                                    }
	                                );

	                            }else{
	                                toaster.pop('info', "", "数据请求失败");
	                            }


	                        }, function (ret) {
	                            $scope.ShowLoading=false;
	                            console.log(ret);
	                            toaster.pop('info', "", "网络请求失败");
	                        }
	                    );
	                }


	            };



	            var setting = {
	              /*  async:{
	                    autoParam:["parentId"],
	                    enable:true,
	                    type:"post",
	                    url:getUrl,
	                   // dataFilter:filter,
	                },*/
	                check : {
	                    chkStyle: "radio",
	                    enable: false,
	                    chkboxType : { "Y" : "s", "N" : "ps" },
	                    radioType : "level"
	                },
	                data: {
	                    simpleData: {
	                        enable: true
	                    }
	                },
	                view: {
	                    expandSpeed: ""
	                },
	                callback: { //请求成功后回调
	                    onClick: onclickTree, //点击相关节点触发的事件
	                    onExpand:onExpandTree,   //点击+号触发事件
	                    onAsyncSuccess: ztreeOnAsyncSuccess, //异步加载成功后执行的方法
	                }
	            };

	            var zNodes =[
	                {id:1379,pId:-1,name:"陕西公司",code:"001001",isParent:true,isRoot:true},
	                {id:1380,pId:-1,name:"西安分公司",code:"001002",isParent:true,isRoot:true},
	                {id:1383,pId:-1,name:"渭南分公司",code:"001003",isParent:true,isRoot:true},
	                {id:1382,pId:-1,name:"榆林分公司",code:"001004",isParent:true,isRoot:true},
	                {id:1384,pId:-1,name:"咸阳分公司",code:"001005",isParent:true,isRoot:true},
	                {id:1385,pId:-1,name:"宝鸡分公司",code:"001006",isParent:true,isRoot:true},
	                {id:1386,pId:-1,name:"延安分公司",code:"001007",isParent:true,isRoot:true},
	                {id:1387,pId:-1,name:"汉中分公司",code:"001008",isParent:true,isRoot:true},
	                {id:1388,pId:-1,name:"安康分公司",code:"001009",isParent:true,isRoot:true},
	                {id:1389,pId:-1,name:"商洛分公司",code:"001010",isParent:true,isRoot:true},
	                {id:1390,pId:-1,name:"铜川分公司",code:"001011",isParent:true,isRoot:true},
	                {id:2668,pId:-1,code:"001012",name:"西咸新区分公司",isParent:true,isRoot:true}
	            ];

	            function onclickTree(event, treeId, treeNode) {
	                $scope.$apply(function() {
	                    console.log(treeNode.code)
	                    $scope.Site.cityId　=treeNode.code
	                });

	               // var treeObj = $.fn.zTree.getZTreeObj(treeId);
	              /*  var node = treeObj.getNodeByTId(treeNode.tId);
	                 console.log(treeObj,treeNode)
	                if (treeNode.isParent&&treeNode) {//判断是否有二级树
	                    $.ajax({
	                        url: ajaxConfig.BASE_URL+ajaxConfig.getDeptListUrl+'?parentId='+treeNode.id,
	                        dataType: "json",
	                        aysnc: true,
	                        success: function(data) {
	                            console.log(data.data)
	                            var json = [];
	                            if(data.data.length>0){
	                                for(var i=0;i<data.data.length;i++){
	                                    json.push({
	                                        id:data.data[i].id,
	                                        pId:treeNode.id,
	                                        name:data.data[i].short_name,
	                                        code:data.data[i].code,
	                                        isParent:true
	                                    })
	                                }
	                            }
	                            newNode = treeObj.addNodes(node, json);
	                        }
	                    });
	                    alert(treeNode.id + treeId + treeNode.name);
	                }*/

	            }

	            function onExpandTree(event, treeId, treeNode) {
	                var treeObj = $.fn.zTree.getZTreeObj(treeId);
	                var node = treeObj.getNodeByTId(treeNode.tId);
	                console.log(treeObj,treeNode)
	                if (treeNode.isRoot&&!treeNode.children) {//判断是否需要加载
	                    $.ajax({
	                        url: ajaxConfig.BASE_URL+ajaxConfig.getDeptListUrl+'?deptCode='+treeNode.code,
	                        dataType: "json",
	                        aysnc: true,
	                        success: function(data) {
	                            console.log(data.data)
	                            var json = [];
	                            if(data.data.length>0){
	                                for(var i=1;i<data.data.length;i++){//这里第一条查到的是自己，因此要从第二条算起
	                                    json.push({
	                                        id:data.data[i].id,
	                                        pId:data.data[i].pid,
	                                        name:data.data[i].shortName,
	                                        code:data.data[i].deptCode,
	                                        isParent:true,
	                                        isRoot:false
	                                    })
	                                }
	                            }
	                            newNode = treeObj.addNodes(node, json);
	                        }
	                    });
	                    //alert(treeNode.id + treeId + treeNode.name);
	                }

	            }
	            //获取树成功后进行的回调操作
	            function ztreeOnAsyncSuccess(event, treeId, treeNode) {
	                console.log(treeId, treeNode)
	                //展开树
	                expand_ztree(treeId)
	            }
	            /**
	             * 展开树
	             * @param treeId
	             */
	            function expand_ztree(treeId) {
	                var treeObj = $.fn.zTree.getZTreeObj(treeId);
	                treeObj.expandAll(true);
	            }



	                /*  var log, className = "dark",
	                      startTime = 0, endTime = 0, perCount = 100, perTime = 100;
	                  function getUrl(treeId, treeNode) {
	                   /!*   var curCount = (treeNode.children) ? treeNode.children.length : 0;
	                      var getCount = (curCount + perCount) > treeNode.count ? (treeNode.count - curCount) : perCount;
	                      var param = "id="+treeNode.id+"_"+(treeNode.times++) +"&count="+getCount;*!/
	                      return ajaxConfig.BASE_URL+ajaxConfig.getDeptListUrl+"?parentId=" + treeNode.id;
	                  }
	                  function beforeExpand(treeId, treeNode) {
	                      if (!treeNode.isAjaxing) {
	                          startTime = new Date();
	                          treeNode.times = 1;
	                          ajaxGetNodes(treeNode, "refresh");
	                          return true;
	                      } else {
	                          alert("zTree 正在下载数据中，请稍后展开节点。。。");
	                          return false;
	                      }
	                  }
	                  function onAsyncSuccess(event, treeId, treeNode, msg) {
	                      if (!msg || msg.length == 0) {
	                          return;
	                      }
	                      var zTree = $.fn.zTree.getZTreeObj("treeDemo"),
	                          totalCount = treeNode.count;
	                      if (treeNode.children.length < totalCount) {
	                          setTimeout(function() {ajaxGetNodes(treeNode);}, perTime);
	                      } else {
	                          treeNode.icon = "";
	                          zTree.updateNode(treeNode);
	                          zTree.selectNode(treeNode.children[0]);
	                          endTime = new Date();
	                          var usedTime = (endTime.getTime() - startTime.getTime())/1000;
	                          className = (className === "dark" ? "":"dark");
	                          showLog("[ "+getTime()+" ]&nbsp;&nbsp;treeNode:" + treeNode.name );
	                          showLog("加载完毕，共进行 "+ (treeNode.times-1) +" 次异步加载, 耗时："+ usedTime + " 秒");
	                      }
	                  }
	                  function onAsyncError(event, treeId, treeNode, XMLHttpRequest, textStatus, errorThrown) {
	                      var zTree = $.fn.zTree.getZTreeObj("treeDemo");
	                      alert("异步获取数据出现异常。");
	                      treeNode.icon = "";
	                      zTree.updateNode(treeNode);
	                  }
	                  function ajaxGetNodes(treeNode, reloadType) {
	                      var zTree = $.fn.zTree.getZTreeObj("treeDemo");
	                      if (reloadType == "refresh") {
	                          treeNode.icon = "../../../css/zTreeStyle/img/loading.gif";
	                          zTree.updateNode(treeNode);
	                      }
	                      zTree.reAsyncChildNodes(treeNode, reloadType, true);
	                  }
	                  function showLog(str) {
	                      if (!log) log = $("#log");
	                      log.append("<li class='"+className+"'>"+str+"</li>");
	                      if(log.children("li").length > 4) {
	                          log.get(0).removeChild(log.children("li")[0]);
	                      }
	                  }
	                  function getTime() {
	                      var now= new Date(),
	                          h=now.getHours(),
	                          m=now.getMinutes(),
	                          s=now.getSeconds(),
	                          ms=now.getMilliseconds();
	                      return (h+":"+m+":"+s+ " " +ms);
	                  }*/

	            $(document).ready(function(){
	                $.fn.zTree.init($("#treeDemo"), setting, zNodes);

	            });







	        }]);

	}());


/***/ },
/* 23 */
/***/ function(module, exports, __webpack_require__) {

	(function () {
	  var business_PUNCH = __webpack_require__(16).business_PUNCH;
	  var punch_model = __webpack_require__(18).punchModel;
	  var ajaxConfig = __webpack_require__(17).ajaxConfigExternal;
	  punch_model = Object.create(punch_model);
	  angular.module('formlyObj.controllers').controller('PunchAddRecordCtrl', ['$scope', '$timeout', '$location', 'constantData', 'GlobalStorageService', 'toaster'
	    , function PunchAddRecordCtrl($scope, $timeout, $location, constantData, GlobalStorageService, toaster) {
	      var self = this;
	      $scope.Record = {
	        userId: "",
	        siteId: "",
	        signType: "-1",
	        inlon: 117.12635,
	        inlat: 39.09037,
	        outlon: 117.12635,
	        outlat: 39.09037,
	        inStatus: "ok",
	        outStatus: "ok",
	        signInTime: "",
	        signOutTime: "",
	        uuid: ""
	      }
	      $scope.siteList = GlobalStorageService.getSiteList();
	      console.log($scope.userInfo);
	      //$scope.Record=GlobalStorageService.getRecord();



	      $scope.changeSite = function () {
	        console.log($scope.Record.siteId);
	        if ($scope.Record.siteId !== '') {
	          for (var i = 0; i < $scope.siteList.length; i++) {
	            if ($scope.siteList[i].id === $scope.Record.siteId) {
	              $scope.Record.inlat = $scope.siteList[i].lat;
	              $scope.Record.inlon = $scope.siteList[i].lon;
	              $scope.Record.outlat = $scope.siteList[i].lat;
	              $scope.Record.outlon = $scope.siteList[i].lon;
	              break;
	            }
	          }
	            punch_model.getSiteWorktime.sid=$scope.Record.siteId;
	            console.log( punch_model.getSiteWorktime);
	            business_PUNCH.getSiteWorktime(punch_model.getSiteWorktime).then(
	                function (req) {
	                    $scope.siteWorktime = req.data;


	                }, function (ret) {
	                    $scope.ShowLoading=false;
	                    console.log(ret);
	                    toaster.pop('info', "", "打卡点规则获取失败");
	                }
	            );
	            console.log( $scope.Record)
	            punch_model.getUUID.loginName=$scope.Record.userId;
	            console.log( punch_model.getUUID);
	            business_PUNCH.getUUID(punch_model.getUUID).then(
	                function (req) {
	                    if(req.uuid){
	                        $scope.$apply(function () {
	                            $scope.Record.uuid = req.uuid;
	                        });
	                    }else{
	                        $scope.Record.uuid = "";
	                    }


	                }, function (ret) {
	                    $scope.ShowLoading=false;
	                    console.log(ret);
	                    toaster.pop('info', "", "打卡点规则获取失败");
	                }
	            );

	        }
	      };

	      $scope.goBack = function () {
	        history.go(-1);
	      };
	      Date.prototype.Format = function (fmt) { //author: meizz
	        var o = {
	          "M+": this.getMonth() + 1,                 //月份
	          "d+": this.getDate(),                    //日
	          "h+": this.getHours(),                   //小时
	          "m+": this.getMinutes(),                 //分
	          "s+": this.getSeconds(),                 //秒
	        };
	        if (/(y+)/.test(fmt))
	          fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
	        for (var k in o)
	          if (new RegExp("(" + k + ")").test(fmt))
	            fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
	        console.log(fmt);
	        return fmt;
	      };

	      $scope.changeRecType = function () {
	        console.log($scope.Record.signType)
	      };

	      $scope.addRecord = function () {
	        try{
	          console.log($scope.Record);
	          if ($scope.Record.siteId === '' || !$scope.Record.siteId) {
	            toaster.pop('info', "", "请选择打卡点");
	          } else if ($scope.Record.userId === '') {
	            toaster.pop('info', "", "请输入用户名");
	          } else if ($scope.Record.signType === '-1' || !$scope.Record.signType) {
	            toaster.pop('info', "", "请输入用户名");
	          } else if ($scope.Record.userId === '') {
	            toaster.pop('info', "", "请输入用户名");
	          }
	          else if($scope.Record.signType ==='all'){
	            if ($scope.Record.signInTimeAM === '' || !$scope.Record.signInTimeAM) {
	              toaster.pop('info', "", "请输入上午签到时间");
	            } else if ($scope.Record.signOutTimeAM === ''|| !$scope.Record.signOutTimeAM) {
	              toaster.pop('info', "", "请输入上午签退时间");
	            }else if ($scope.Record.signInTimePM === ''|| !$scope.Record.signInTimePM) {
	              toaster.pop('info', "", "请输入下午签到时间");
	            } else if ($scope.Record.signOutTimePM === ''|| !$scope.Record.signOutTimePM) {
	              toaster.pop('info', "", "请输入下午签退时间");
	            } else if ($scope.Record.signInTimeAM > $scope.Record.signOutTimeAM) {
	              toaster.pop('info', "", "上午签到时间不能晚于签退时间");
	            } else if ($scope.Record.signInTimePM > $scope.Record.signOutTimePM) {
	              toaster.pop('info', "", "下午签到时间不能晚于签退时间");
	            }else {
	              console.log(new Date($scope.Record.signInTimeAM).Format("yyyy-MM-dd hh:mm:ss"));
	              $scope.Record.signInTimeA = new Date($scope.Record.signInTimeAM).Format("yyyy-MM-dd hh:mm:ss");
	              $scope.Record.signOutTimeA = new Date($scope.Record.signOutTimeAM).Format("yyyy-MM-dd hh:mm:ss");
	              $scope.Record.signInTimeP = new Date($scope.Record.signInTimePM).Format("yyyy-MM-dd hh:mm:ss");
	              $scope.Record.signOutTimeP = new Date($scope.Record.signOutTimePM).Format("yyyy-MM-dd hh:mm:ss");
	              console.log($scope.Record);
	              punch_model.insertRecord.userId = $scope.Record.userId;
	              punch_model.insertRecord.siteId = $scope.Record.siteId;
	              punch_model.insertRecord.inlon = $scope.Record.inlon.toString();
	              punch_model.insertRecord.inlat = $scope.Record.inlat.toString();
	              punch_model.insertRecord.inStatus = $scope.Record.inStatus;
	              punch_model.insertRecord.outlat = $scope.Record.outlat.toString();
	              punch_model.insertRecord.outlon = $scope.Record.outlon.toString();
	              punch_model.insertRecord.outStatus = $scope.Record.outStatus;
	              punch_model.insertRecord.signType = 'am';
	              punch_model.insertRecord.signInTime = $scope.Record.signInTimeA;
	              punch_model.insertRecord.signOutTime = $scope.Record.signOutTimeA;
	              //punch_model.insertRecord.uuid = $scope.Record.uuid;

	                punch_model.insertRecord.inWorkType=null;
	                punch_model.insertRecord.outWorkType=null;
	                punch_model.insertRecord.inLocation=null;
	                punch_model.insertRecord.outLocation=null;
	                punch_model.insertRecord.inRemark="补卡";
	                punch_model.insertRecord.outRemark="补卡";
	                punch_model.insertRecord.inUuid=$scope.Record.uuid;
	                punch_model.insertRecord.outUuid=$scope.Record.uuid;;
	                punch_model.insertRecord.inSiteId=$scope.Record.siteId;
	                punch_model.insertRecord.outSiteId=$scope.Record.siteId;
	                punch_model.insertRecord.fixInTime= $scope.siteWorktime[0].signInTime;
	                punch_model.insertRecord.fixOutTime=$scope.siteWorktime[0].signOutTime;

	              console.log(punch_model.insertRecord);
	              business_PUNCH.insertRecord(JSON.stringify(punch_model.insertRecord)).then(
	                function (req) {
	                  console.log(req);
	                  if (req.status === '1') {
	                    toaster.pop('info', "", "添加上午成功");
	                    punch_model.insertRecord.userId = $scope.Record.userId;
	                    punch_model.insertRecord.siteId = $scope.Record.siteId;
	                    punch_model.insertRecord.inlon = $scope.Record.inlon;
	                    punch_model.insertRecord.inlat = $scope.Record.inlat;
	                    punch_model.insertRecord.inStatus = $scope.Record.inStatus;
	                    punch_model.insertRecord.outlat = $scope.Record.outlat;
	                    punch_model.insertRecord.outlon = $scope.Record.outlon;
	                    punch_model.insertRecord.outStatus = $scope.Record.outStatus;
	                    punch_model.insertRecord.signType = 'pm';
	                    punch_model.insertRecord.signInTime = $scope.Record.signInTimeP;
	                    punch_model.insertRecord.signOutTime = $scope.Record.signOutTimeP;
	                    punch_model.insertRecord.uuid = $scope.Record.uuid;

	                      punch_model.insertRecord.inWorkType=null;
	                      punch_model.insertRecord.outWorkType=null;
	                      punch_model.insertRecord.inLocation=null;
	                      punch_model.insertRecord.outLocation=null;
	                      punch_model.insertRecord.inRemark="补卡";
	                      punch_model.insertRecord.outRemark="补卡";
	                      punch_model.insertRecord.inUuid=$scope.Record.uuid;
	                      punch_model.insertRecord.outUuid=$scope.Record.uuid;;
	                      punch_model.insertRecord.inSiteId=$scope.Record.siteId;
	                      punch_model.insertRecord.outSiteId=$scope.Record.siteId;
	                      punch_model.insertRecord.fixInTime= $scope.siteWorktime[1].signInTime;
	                      punch_model.insertRecord.fixOutTime=$scope.siteWorktime[1].signOutTime;
	                    console.log(punch_model.insertRecord);
	                    business_PUNCH.insertRecord(JSON.stringify(punch_model.insertRecord)).then(
	                      function (req1) {
	                        console.log(req1);
	                        if (req1.status === '1') {
	                          toaster.pop('info', "", "添加下午成功");
	                          history.go(-1);
	                        } else {
	                          toaster.pop('info', "", "数据请求失败");
	                        }


	                      }, function (ret1) {
	                        $scope.ShowLoading = false;
	                        console.log(ret1);
	                        toaster.pop('info', "", "网络请求失败");
	                      }
	                    );
	                  } else {
	                    toaster.pop('info', "", "数据请求失败");
	                  }


	                }, function (ret) {
	                  $scope.ShowLoading = false;
	                  console.log(ret);
	                  toaster.pop('info', "", "网络请求失败");
	                }
	              );
	            }
	          }
	          else if($scope.Record.signType ==='am' || $scope.Record.signType ==='pm' ){

	            if ($scope.Record.signInTimeF === '' || !$scope.Record.signInTimeF) {
	              toaster.pop('info', "", "请输入签到时间");
	            } else if ($scope.Record.signOutTimeF === '' || !$scope.Record.signOutTimeF) {
	              toaster.pop('info', "", "请输入签退时间");
	            } else if ($scope.Record.signInTimeF > $scope.Record.signOutTimeF) {
	              toaster.pop('info', "", "签到时间不能晚于签退时间");
	            }  else {
	              console.log(new Date($scope.Record.signInTimeF).Format("yyyy-MM-dd hh:mm:ss"));
	              $scope.Record.signInTime = new Date($scope.Record.signInTimeF).Format("yyyy-MM-dd hh:mm:ss");
	              $scope.Record.signOutTime = new Date($scope.Record.signOutTimeF).Format("yyyy-MM-dd hh:mm:ss");
	              console.log($scope.Record);
	              punch_model.insertRecord.userId = $scope.Record.userId;
	              punch_model.insertRecord.siteId = $scope.Record.siteId;
	              punch_model.insertRecord.inlon = $scope.Record.inlon;
	              punch_model.insertRecord.inlat = $scope.Record.inlat;
	              punch_model.insertRecord.inStatus = $scope.Record.inStatus;
	              punch_model.insertRecord.outlat = $scope.Record.outlat;
	              punch_model.insertRecord.outlon = $scope.Record.outlon;
	              punch_model.insertRecord.outStatus = $scope.Record.outStatus;
	              punch_model.insertRecord.signType = $scope.Record.signType;
	              punch_model.insertRecord.signInTime = $scope.Record.signInTime;
	              punch_model.insertRecord.signOutTime = $scope.Record.signOutTime;
	              punch_model.insertRecord.uuid = $scope.Record.uuid;

	                punch_model.insertRecord.inWorkType=null;
	                punch_model.insertRecord.outWorkType=null;
	                punch_model.insertRecord.inLocation=null;
	                punch_model.insertRecord.outLocation=null;
	                punch_model.insertRecord.inRemark="补卡";
	                punch_model.insertRecord.outRemark="补卡";
	                punch_model.insertRecord.inUuid=$scope.Record.uuid;
	                punch_model.insertRecord.outUuid=$scope.Record.uuid;;
	                punch_model.insertRecord.inSiteId=$scope.Record.siteId;
	                punch_model.insertRecord.outSiteId=$scope.Record.siteId;
	                if($scope.Record.signType=== 'am'){

	                    punch_model.insertRecord.fixInTime= $scope.siteWorktime[0].signInTime;
	                    punch_model.insertRecord.fixOutTime=$scope.siteWorktime[0].signOutTime;
	                }else{

	                    punch_model.insertRecord.fixInTime= $scope.siteWorktime[1].signInTime;
	                    punch_model.insertRecord.fixOutTime=$scope.siteWorktime[1].signOutTime;
	                }
	              console.log(punch_model.insertRecord);
	              business_PUNCH.insertRecord(JSON.stringify(punch_model.insertRecord)).then(
	                function (req) {
	                  console.log(req);
	                  if (req.status === '1') {
	                    toaster.pop('info', "", "添加成功");
	                    history.go(-1);
	                  } else {
	                    toaster.pop('info', "", "数据请求失败");
	                  }


	                }, function (ret) {
	                  $scope.ShowLoading = false;
	                  console.log(ret);
	                  toaster.pop('info', "", "网络请求失败");
	                }
	              );
	            }
	          }
	        }catch (e) {
	          toaster.pop('info', "", "请求错误");
	          console.log(e);
	        }



	      };

	      $scope.editRecord = function () {
	        punch_model.editWhiteList.userId = $scope.userInfo.userid;
	        punch_model.editWhiteList.userName = $scope.userInfo.username;
	        punch_model.editWhiteList.siteId = $scope.userInfo.siteid;
	        punch_model.editWhiteList.id = $scope.userInfo.id;

	        business_PUNCH.editWhiteList(JSON.stringify(punch_model.editWhiteList)).then(
	          function (req) {
	            console.log(req);
	            if (req.status === '1') {
	              toaster.pop('info', "", "修改成功");
	              history.go(-1);
	            } else {
	              toaster.pop('info', "", "数据请求失败");
	            }


	          }, function (ret) {
	            $scope.ShowLoading = false;
	            console.log(ret);
	            toaster.pop('info', "", "网络请求失败");
	          }
	        );

	      };

	    }]);

	}());


/***/ },
/* 24 */
/***/ function(module, exports, __webpack_require__) {

	(function () {
	    var business_PUNCH = __webpack_require__(16).business_PUNCH;
	    var punch_model = __webpack_require__(18).punchModel;
	    var ajaxConfig = __webpack_require__(17).ajaxConfigExternal;
	    punch_model = Object.create(punch_model);
	    angular.module('formlyObj.controllers').controller('PunchEditRecordCtrl', ['$scope', '$timeout', '$location', 'constantData', 'GlobalStorageService','toaster'
	        , function PunchEditRecordCtrl($scope, $timeout, $location, constantData, GlobalStorageService,toaster) {
	            var self = this;
	            $scope.Record=GlobalStorageService.getRecord();
	            $scope.siteList=GlobalStorageService.getSiteList();
	            console.log($scope.siteList);
	            console.log(  $scope.userInfo);
	            $scope.Record.signInTimeF=new Date( $scope.Record.signInTime);
	            $scope.Record.signOutTimeF=new Date( $scope.Record.signOutTime);
	            $scope.Record.signInTimeOld=$scope.Record.signInTime;
	            $scope.Record.signOutTimeOld=$scope.Record.signOutTime;
	            //
	            $scope.getUUID =function (){
	                punch_model.getUUID.loginName=$scope.Record.userId;
	                console.log( punch_model.getUUID);
	                business_PUNCH.getUUID(punch_model.getUUID).then(
	                    function (req) {
	                        if(req.uuid){
	                            $scope.$apply(function () {
	                                $scope.Record.uuid = req.uuid;
	                            });
	                        }else{
	                            $scope.Record.uuid = "";
	                        }


	                    }, function (ret) {
	                        $scope.ShowLoading=false;
	                        console.log(ret);
	                        toaster.pop('info', "", "打卡点规则获取失败");
	                    }
	                );
	            };
	            $scope.getUUID();

	            $scope.changeSite = function () {
	                console.log($scope.Record.siteId);
	                if($scope.Record.siteId!==''){
	                    for(var i=0;i<$scope.siteList.length;i++){
	                        if($scope.siteList[i].id===$scope.Record.siteId){
	                            $scope.Record.inlat=$scope.siteList[i].lat;
	                            $scope.Record.inlon=$scope.siteList[i].lon;
	                            $scope.Record.outlat=$scope.siteList[i].lat;
	                            $scope.Record.outlon=$scope.siteList[i].lon;
	                            console.log( $scope.siteList[i])
	                            break;
	                        }
	                    }
	                    punch_model.getSiteWorktime.sid=$scope.Record.siteId;
	                    console.log( punch_model.getSiteWorktime);
	                    business_PUNCH.getSiteWorktime(punch_model.getSiteWorktime).then(
	                        function (req) {
	                            $scope.siteWorktime = req.data;


	                        }, function (ret) {
	                            $scope.ShowLoading=false;
	                            console.log(ret);
	                            toaster.pop('info', "", "打卡点规则获取失败");
	                        }
	                    );


	                }

	            };
	            $scope.changeSite();

	            $scope.goBack = function () {
	                history.go(-1);
	            };
	            Date.prototype.Format = function (fmt) { //author: meizz
	                var o = {
	                    "M+": this.getMonth() + 1,                 //月份
	                    "d+": this.getDate(),                    //日
	                    "h+": this.getHours(),                   //小时
	                    "m+": this.getMinutes(),                 //分
	                    "s+": this.getSeconds(),                 //秒
	                };
	                if (/(y+)/.test(fmt))
	                    fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
	                for (var k in o)
	                    if (new RegExp("(" + k + ")").test(fmt))
	                        fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
	                console.log(fmt);
	                return fmt;
	            };

	            $scope.editRecord = function () {
	               console.log( $scope.Record);
	               if($scope.Record.siteId===''||!$scope.Record.siteId){
	                   toaster.pop('info', "", "请选择打卡点");
	               }else if($scope.Record.userId===''){
	                   toaster.pop('info', "", "请输入用户名");
	               }else if($scope.Record.userId===''){
	                   toaster.pop('info', "", "请输入用户名");
	               }else if($scope.Record.signInTimeF===''){
	                   toaster.pop('info', "", "请输入签到时间");
	               }else if($scope.Record.signOutTimeF===''){
	                   toaster.pop('info', "", "请输入签退时间");
	               }else if($scope.Record.signInTimeF>$scope.Record.signOutTimeF){
	                   toaster.pop('info', "", "签到时间不能晚于签退时间");
	               }else{
	                   console.log(new Date( $scope.Record.signInTimeF).Format("yyyy-MM-dd hh:mm:ss"));
	                   $scope.Record.signInTime=new Date( $scope.Record.signInTimeF).Format("yyyy-MM-dd hh:mm:ss");
	                   $scope.Record.signOutTime=new Date( $scope.Record.signOutTimeF).Format("yyyy-MM-dd hh:mm:ss");
	                   console.log( $scope.Record);

	                   punch_model.updateRecord.id=$scope.Record.id;
	                   punch_model.updateRecord.userId = $scope.Record.userId;
	                   punch_model.updateRecord.siteId = $scope.Record.siteId;
	                   punch_model.updateRecord.inlon = $scope.Record.inlon.toString();
	                   punch_model.updateRecord.inlat = $scope.Record.inlat.toString();
	                   punch_model.updateRecord.inStatus = $scope.Record.inStatus;
	                   punch_model.updateRecord.outlat = $scope.Record.outlat.toString();
	                   punch_model.updateRecord.outlon = $scope.Record.outlon.toString();
	                   punch_model.updateRecord.outStatus = $scope.Record.outStatus;

	                   punch_model.updateRecord.signType=$scope.Record.signType;
	                   punch_model.updateRecord.signInTime = $scope.Record.signInTime;
	                   punch_model.updateRecord.signOutTime = $scope.Record.signOutTime;
	                   punch_model.updateRecord.signInTimeOld=$scope.Record.signInTimeOld;
	                   punch_model.updateRecord.signOutTimeOld=$scope.Record.signOutTimeOld;
	                   punch_model.updateRecord.sign_change=1;
	                   //punch_model.insertRecord.uuid = $scope.Record.uuid;

	                   punch_model.updateRecord.inWorkType=null;
	                   punch_model.updateRecord.outWorkType=null;
	                   punch_model.updateRecord.inLocation=null;
	                   punch_model.updateRecord.outLocation=null;
	                   punch_model.updateRecord.inRemark="补卡";
	                   punch_model.updateRecord.outRemark="补卡";
	                   punch_model.updateRecord.inUuid=$scope.Record.uuid;
	                   punch_model.updateRecord.outUuid=$scope.Record.uuid;;
	                   punch_model.updateRecord.inSiteId=$scope.Record.siteId;
	                   punch_model.updateRecord.outSiteId=$scope.Record.siteId;
	                   punch_model.updateRecord.fixInTime= $scope.siteWorktime[0].signInTime;
	                   punch_model.updateRecord.fixOutTime=$scope.siteWorktime[0].signOutTime;

	               /*    punch_model.updateRecord.id=$scope.Record.id;
	                   punch_model.updateRecord.userId=$scope.Record.userId;
	                   punch_model.updateRecord.siteId=$scope.Record.siteId;
	                   punch_model.updateRecord.inlon=$scope.Record.inlon;
	                   punch_model.updateRecord.inlat=$scope.Record.inlat;
	                   punch_model.updateRecord.inStatus=$scope.Record.inStatus;
	                   punch_model.updateRecord.outlat=$scope.Record.outlat;
	                   punch_model.updateRecord.outlon=$scope.Record.outlon;
	                   punch_model.updateRecord.outStatus=$scope.Record.outStatus;
	                   punch_model.updateRecord.signType=$scope.Record.signType;
	                   punch_model.updateRecord.signInTime=$scope.Record.signInTime;
	                   punch_model.updateRecord.signOutTime=$scope.Record.signOutTime;
	                   punch_model.updateRecord.signInTimeOld=$scope.Record.signInTimeOld;
	                   punch_model.updateRecord.signOutTimeOld=$scope.Record.signOutTimeOld;
	                   punch_model.updateRecord.sign_change=1;

	                   punch_model.updateRecord.inLocation=null;
	                   punch_model.updateRecord.outLocation=null;
	                   punch_model.updateRecord.inRemark="补卡";
	                   punch_model.updateRecord.outRemark="补卡";
	                   punch_model.updateRecord.inUuid=$scope.Record.uuid;;
	                   punch_model.updateRecord.outUuid=$scope.Record.uuid;;
	                   punch_model.updateRecord.inSiteId=$scope.Record.siteId;
	                   punch_model.updateRecord.outSiteId=$scope.Record.siteId;
	                   punch_model.updateRecord.fixInTime=$scope.Record.fixInTime;
	                   punch_model.updateRecord.fixOutTime=$scope.Record.fixOutTime;
	*/
	                   console.log( punch_model.updateRecord);
	                   business_PUNCH.updateRecord(JSON.stringify(punch_model.updateRecord)).then(
	                       function (req) {
	                           console.log(req);
	                           if (req.status === '1') {
	                               toaster.pop('info', "", "添加成功");
	                               history.go(-1);
	                           }else{
	                               toaster.pop('info', "", "数据请求失败");
	                           }


	                       }, function (ret) {
	                           $scope.ShowLoading=false;
	                           console.log(ret);
	                           toaster.pop('info', "", "网络请求失败");
	                       }
	                   );
	               }

	            };

	        $scope.delConfirm = function (message, item) {
	          var dialogIns;
	          function initDialog(){
	            $(function(){

	              dialogIns=  $(".ConfirmMsgDelSite").dialog({
	                autoOpen: false,
	                width: 300,
	                modal: true,
	                position:{ using:function(pos){
	                    console.log(pos)
	                    var topOffset = $(this).css(pos).offset().top;
	                    if (topOffset = 0||topOffset>0) {
	                      $(this).css('top', 150);
	                    }
	                  }},
	                buttons: {
	                  "我再想想": function() {
	                    $(this).dialog('close');
	                    // $scope.dialogText="";
	                  },
	                  "确认": function() {
	                    //mDialogCallback(false);
	                    $scope.delRecord();
	                    $(this).dialog('close');
	                    //  $scope.dialogText="";
	                  }
	                }
	              });
	            })
	          }
	          $scope.delitem=item;
	           $scope.dialogText="确认删除该打卡记录么？";
	          initDialog();


	          dialogIns.dialog('open');

	          //  $('#ConfirmMsgBody').html(message);

	        };
	        $scope.delRecord = function () {
	          punch_model.delRecord.id = $scope.Record.id;
	          $scope.ShowLoading=true;
	          business_PUNCH.delRecord(punch_model.delRecord).then(
	            function (req) {
	              $scope.ShowLoading=false;
	              if (req.status === '1') {//缺一个确认
	                toaster.pop('info', "", "删除成功");
	                history.go(-1);

	              } else {
	                toaster.pop('info', "", "获取数据失败");
	                if(req.message=='not login admin'){
	                  alert('您没有管理员权限，请先登录');
	                  $location.path("/loginAdmin");
	                }

	              }

	            }, function (ret) {
	              $scope.ShowLoading=false;
	              console.log(ret);
	              toaster.pop('info', "", "网络请求失败");
	            }
	          );
	        };

	        }]);

	}());


/***/ }
/******/ ]);